JSON Insert Action
You can use the Insert action to create a new record. Records are created either by following a Select action or by being executed as part of an invoked function. The typical format of an Insert action is as follows:
[{\"action\":\"insert\", \"module\":\"MODULEID\",\"parentmodule\":\"PARENTMODULEID\", \"parentuid\":\"rowidxxx\",\"fields\": [ { \"field\":\"MEFIELDNAME\", \"value\":\"Value to insert\" }], \"upsync\":\"yes\"}]
where:
\"action\":\"insert\" starts the Insert action.
\"module\":\"MODULEID\" defines the type of record to create. If you are creating a record within module 18 for example, then replace MODULEID with 18.
\"parentmodule\":\"PARENTMODULEID\" specifies which record to relate this object to (if applicable) using the parentmodule parameter. PARENTMODULEID is replaced with the module number of the parent object.
\"parentuid\":\"rowidxxx\" determines the exact record to which the new record is related. The rowid of the parent is inserted into rowidxxx. The rowid (uid) is usually returned as a variable from an invoked function. You can also use a Select action to select an individual record.
\"fields\":[ { \"field\":\"MEFIELDNAME\", \"value\":\"Value to insert\" } ] defines which field is being updated and the value being written. MEFIELDNAME defines the field being updated, and "Value to insert\" is replaced with the data or variable (if part of an invoked function) that is to be inserted into the field.
\"upsync\":\"yes\" defines whether the inserted record is written to the data source (Yes) or only stored on the mobile device (No).
If using an Insert action to configure custom action buttons, then the Insert action also supports the showui flag. The showui flag defines whether to display the record after insert (Yes) or not (No). The format of an Insert action with showui is as follows:
[{\"action\":\"insert\",\"module\":\"7\",\"parentmodule\":\"1\",\"parentuid\":\""+ accountDetails[0]._1.uid+"\", \"fields\":[{\"field\":\"CLOGKW03\",\"value\":\"Account Call\" }, {\"field\":\"CLOGTXT05\",\"value\":\""objective"\" }],\"upsync\":\"YES\",\"showui\":\"YES\"}]