JSON Update Action
An Update action is usually defined as part of an invoked function and called from within a select query.
You can set a number of variables in the invoked function, including the row IDs of several records. All variables and row IDs are updated as part of the same piece of code.
The typical format of an Update action follows. In this example, it is assumed that a query has been run to determine the value of xxxrowid and the value being written to valuexxx.
[{\"module\":\"MODULEID\", \"uid\":\"xxxrowid\",\"fields\":[ {\"field\":\"MEFIELDID\", \"value\":\"valuexxx"\" } ], \"action\":\"update\",\"upsync\":\"yes\", \"filter\":\"MODULEID.uid ="xxxrowid\"}"
where:
- \"module\":\"MODULEID\" determines which module is being updated.
- \"uid\":\"xxxrowid\" specifies the rowid of the record that is read during the invoked function query.
- \"fields\":[ { \"field\":\"MEFIELDID\", \"value\":\"valuexxx"\" } ] specifies the field to update, followed by the value parameter to determine the value to write to the record.
- \"action\":\"update\" executes the Update action.
- \"upsync\":\"yes\" determines whether the Update action is written to the data source (Yes), or if only the local database stored on the device is updated (No). Synchronization upload allows user devices to maintain a record of objects such as an updated inventory, without submitting those changes to the data source. If no flag is specified, then upsync defaults to Yes (update the data source).
- \"filter\":\"MODULEID.uid ="xxxrowid\" ensures that only the record that is read is updated during the invoked function by specifying the row ID to update.