ctm.update
The method of JS Bridge functionality is intended to bulk edit fields of offline objects if the current user has permission to edit records of the appropriate object and access to fields of that object.
Query Format
ctm.update([SObject], handler)
SObject is the JS object that indicates the API name of the offline object, the ID of the record to update, and a list of fields with values.
Handler
Use a handler function to describe the output format of the query results, e.g., to display the results of operations or method errors for debugging purposes.
ctm.update([{"SObject": "Account", "Id":"0011w00000VFNzC", "Name": "IBM"}])
var updateString = '[{"SObject":"Account", , "Id": "DSFS-2342-TYRE-ADSFBA374Q8RQ8", "Name":"Test Account"}]';
var updateObject = JSON.parse(updateString);
ctm.update(updateObject, function(response){
console.log('Update result', response);
})
The result:
{
"result": [
{
"Id": "0011w00000VFNzC",
"Name": "IBM"
}
],
"success": true,
}