...
Table of Contents |
---|
...
"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.
Code Block | |||||
---|---|---|---|---|---|
js | |||||
Anchor | create | create | |||
Panel |
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.
Note |
---|
Multiple create, update, or delete requestsdelete requests MUST NOTNOT run concurrently, and should instead be run sequentially. Furthermore, this API will have the following effects (if these features are enabled):
|
Code Block | language | js|||
---|---|---|---|---|
var request = {
"type" : "create",
"object" : "Account",
"data" : { "Name" : "John Doe Industries", "Phone" : "867-5309" },
"args" : { "skipLayoutRequiredFieldCheck allowEditOnFailure" : "FALSE"} , // OPTIONAL :if DEFAULTspecified as IS "TRUE", --will Allowavoid editingchecking thefor recordmissing usinglayout therequired Pulsarfields object}; bridge.sendRequest(request, function (responseData) { alert('Javascript got its create response: ' + responseData); }); Anchor | | update | update | |
Panel |
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
...
.
Note |
---|
Multiple create, update, or delete requestsdelete requests MUST NOTNOT run concurrently, and should instead be run sequentially. Furthermore, this API will have the following effects (if these features are enabled):
|
Code Block | language | js|||
---|---|---|---|---|
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);
}); Anchor | | delete | delete | paneltitle |
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.
...
Note |
---|
Multiple create, update, or delete requestsdelete requests MUST NOTNOT run concurrently, and should instead be run sequentially. Furthermore, this API will have the following effects (if these features are enabled):
|
Code Block | language | js
---|---|
var request = { "type" : "delete", "object" : "Account", "data" : { "Id" : "001234567891234" } // only Id is required }; bridge.sendRequest(request, function (responseData) { alert('Javascript got its delete response: ' + responseData);
}); panel | title |
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.
Warning |
---|
Note |
Multiple create, update, or delete requests . FurthermoreMUST NOT run concurrently, and should instead be run sequentially. Furthermore, this API will have the following effects (if these features are enabled):
|
Info |
---|
The deletebatch API allows efficiently deleting multiple objects, provided as an array of object Ids. See the example syntax below. |
Code Block | |
---|---|
js |
Sample response:
Code Block | ||||
---|---|---|---|---|
json | ||||
Section | ||||
Anchor | | select | select | |
Panel |
Local SQL Queries
...
Select (read-only local query)
Note | icon | false
---|
Info |
The select request allows advanced users to create an arbitrary select query using Pulsar's built in database engine. |
Code Block | ||||
---|---|---|---|---|
var request = { "type" : "select", "object" : "Account", "data" : { "query" : "Select Id from Account Where Name like '%hello%'" } }; bridge.sendRequest(request, function (responseData) { alert('Javascript got its select response: ' + responseData);
}); Anchor | | update | update | paneltitle |
Update (local update query)
Note | |
---|---|
Info | |
Note |
Note | ||
---|---|---|
title | ||
Code Block |
Info |
---|
When Pulsar is in online mode, the |
Code Block |
---|
var request = {
"type" : "updateQuery",
"object" : "Account",
"data" : { "query" : "UPDATE Account SET ActiveCustomer__c = 'TRUE' WHERE OpportunityCount__c > 0;" }
};
bridge.sendRequest(request, function (responseData) {
alert('Javascript got its update query response: ' + responseData);
}); |
Sample Response (with a reported Salesforce error):
Code Block |
---|
Response: { "type": "updateQueryResponse", "object": "Account", "data": " datasuccess",: {"query errors" : "UPDATE[Account SET ActiveCustomer__c = 'TRUE' WHERE OpportunityCount__c > 0;" }
};
bridge.sendRequest(request, function (responseData) {
alert('Javascript got its update query response: ' + responseData);
}); {
"errorCode": "ENTITY_IS_LOCKED",
"message": "This record is locked. If you need to edit it, contact your admin."
}
]
} |