ctm.delete
The method of the JS Bridge functionality is intended to bulk delete fields of records of offline objects:
-
the user profile should have permission to delete records of the required object.
-
permission to delete the required offline object is allowed.
Query Format
ctm.delete([SObject], handler)
SObject is the JS object that indicates the API name of the offline object and the ID of the record to delete.
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.delete([{"SObject": "Account", "Id":"a0y1w000000Ck4x"}])
var deleteString = '[{"SObject":"Account", "Id": "DSFS-2342-TYRE-ADSFBA374Q8RQ8"}]';
var deleteObject = JSON.parse(deleteString);
ctm.delete(deleteObject, function(response){
console.log('Delete result', response);
})
The result:
{
"result": [
{
"Id": "a0y1w000000Ck4x"
}
],
"success": true,
}