Local Database API (CRUD requests)

"CRUD" Request Types

Read

Read object data from the database. This API will filter the objects based on the field names and values in the data portion of the request. There is no way to limit the fields returned by this API, so full object data will always be returned.

var request = { "type" : "read", "object" : "Account", "data" : { "Name" : "John Doe Industries" } }; bridge.sendRequest(request, function (responseData) { alert('Javascript got its read response: ' + responseData); });

Create

Create a Salesforce Object. This API will create only one object per request using the field names and values provided in the data portion of the request. This is equivalent to saving a new record from the Pulsar native user interface. Optionally, specifying the argument skipLayoutRequitedFieldCheck as TRUE will avoid checking for fields marked required on the Salesforce layout for the object. The default behavior for is to display Pulsar’s record create screen if a field validation error or record creation error occurs. To disable this behavior, specify the allowEditOnFailure argument with a value of FALSE.

Multiple create, update, or delete requests MUST NOT run concurrently, and should instead be run sequentially. Furthermore, this API will have the following effects (if these features are enabled):

  • run PSL Object Triggers for the record(s) in question

  • process SFDC ValidationRules for the record(s) in question

  • re-calculate and save formula fields for the record(s) in question

  • re-calculate roll-up summary fields on parent object(s) records(s) for record(s) in question

var request = { "type" : "create", "object" : "Account", "data" : { "Name" : "John Doe Industries", "Phone" : "867-5309" }, "args" : { "allowEditOnFailure" : "FALSE", // OPTIONAL : DEFAULT IS "TRUE"-- Allow editing the record using the Pulsar object edit screen to fix errors on a create failure "skipLayoutRequiredFieldCheck" : "FALSE" // <-- OPTIONAL : if specified as "TRUE", will avoid checking for missing layout required fields }}; bridge.sendRequest(request, function (responseData) { alert('Javascript got its create response: ' + responseData); });

Update (single record only)

Update an existing Salesforce Object. This API will update only one object per request using the field names and values provided in the data portion of the request. The Id field is required to identify the record to update. This is equivalent to saving a record from the Pulsar native user interface. Optionally, specifying the argument skipLayoutRequiredFieldCheck as TRUE will avoid checking for fields marked required on the Salesforce layout for the object.

Multiple create, update, or delete requests MUST NOT run concurrently, and should instead be run sequentially. Furthermore, this API will have the following effects (if these features are enabled):

  • run PSL Object Triggers for the record(s) in question

  • process SFDC ValidationRules for the record(s) in question

  • re-calculate and save formula fields for the record(s) in question

  • re-calculate roll-up summary fields on parent object(s) records(s) for record(s) in question

var request = { "type" : "update", "object" : "Account", "data" : { "Id" : "001234567891234", "Name" : "John Doe Industries, Inc", "Phone" : "(555) 867-5309" }, // Id is a required field to identify the record to update "args" : { "skipLayoutRequiredFieldCheck" : "FALSE" // OPTIONAL : if specified as "TRUE", will avoid checking for missing layout required fields } }; bridge.sendRequest(request, function (responseData) { alert('Javascript got its update response: ' + responseData); });

Delete (single record only)

Delete an existing Salesforce Object. This API will delete only one object per request using the Id field to identify the record. This is equivalent to deleting a record from the Pulsar native user interface. 

Multiple create, update, or delete requests MUST NOT run concurrently, and should instead be run sequentially. Furthermore, this API will have the following effects (if these features are enabled):

  • run PSL Object Triggers for the record(s) in question

  • process SFDC ValidationRules for the record(s) in question

  • re-calculate and save formula fields for the record(s) in question

  • re-calculate roll-up summary fields on parent object(s) records(s) for record(s) in question

Batch Delete

Deletes an existing set of Salesforce objects. This API will delete multiple objects per request using the objectIdList paramter to identify the records. This is equivalent to deleting the records sequentially from the Pulsar native user interface.

Sample response:

Local SQL Queries

Select (read-only local query)

Update (local update query)

Sample Response (with a reported Salesforce error):

Related pages