JavaScript Object Notation Actions

The Table below describes the JSON actions that you can use in JavaScript code.

Table 6.JSON Actions

Action

Type

Description

Select

Primary Action

Defines which modules and fields to use to determine when an action is performed. You also use the Select function to filter which records are read. For more information, see "JSON Select Action".

Update

Primary or Secondary Action

Updates an existing record with new values. You use Update almost exclusively as a secondary action, after using Select and Invoke to read data and perform data validation.

You can also use Update as a primary action. In this case, the Update action runs when the predefined JSON function button is selected and no data validation or checks are carried out.

For more information, see "JSON Update Action".

Insert

Primary or Secondary Action

Creates a new record, and inserts values into any of the fields within that record. You use Insert almost exclusively as a secondary action.

You can also use Insert as a primary action. In this case, the Insert action runs when the predefined JSON function button is selected and no validation is carried out on existing data.

For more information, see "JSON Insert Action".

Validate

Secondary Action

The validate action is usually performed from within an invoked function, which determines a set of conditions. If the conditions are met, then a variable is set to True. If the conditions are not met, then a variable is set to False.

If a True value is included in a Validate action, then the user is allowed to change the current record. If a False value is included in a Validate action, then the user is not allowed to change the current record and is returned to the data entry page.

For more information, see "JSON Validate Action".

goToURL

Alternate Action

Sends data to an external application using the device URL code for the external application. For more information, see "JSON goToURL Action".

getCondition

Alternate Action

Selects which records to display to the user. For more information, see "JSON getCondition Action".

Showprompt

Alternate Action

Presents a dialog box with a message to the user, and waits for a response from the user. For more information, see "JSON Showprompt Action".

ExitpageAlternate ActionExits page which is open. If you have opened a sub-page using window.open or location href, you will not close the page using this action. It will close the page when you have opened a sub page using targetframe. Syntax is: {\"action\":\"exitpage\",\"refresh\":\"yes\"}