Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
"CRUD" Request Types
Read
Description
The Read API retrieves object data from the database . This API will filter the objects based on the field names and values in the based on specified field-value pairs. The API filters objects using the fields and values provided 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.
...
The API performs an exact match on the fields values. Supplying fields that do not exist on the SObject will result in failures.
This API always returns full object data for matching records. There is currently no way to limit the fields returned.
Request Parameters
type
(string, required) – Must be set to"read"
to indicate a read operation.object
(string, required) – The name of the Salesforce SObject to query (e.g.,"Account"
,"Contact"
).data
(object, required) – A key-value mapping where:Keys represent field names of the specified
object
.Values represent the filter criteria. Only objects matching all field-value pairs will be returned.
Example Request
The following request retrieves all Account
objects where the Name
field is "John Doe Industries"
:
Code Block | ||
---|---|---|
| ||
var request = { "type" : "read", "object" : "Account", "data" : { "Name" : "John Doe Industries" } }; bridge.send(request, function (responseData) { if 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.
Note |
---|
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):
|
Code Block |
---|
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.
Note |
---|
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):
|
Code Block |
---|
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.
Note |
---|
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):
|
Code Block |
---|
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);
}); |
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.
Note |
---|
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):
|
Info |
---|
The deletebatch API allows efficiently deleting multiple objects, provided as an array of object Ids. See the example syntax below. |
Code Block |
---|
var request = {
"type" : "deletebatch",
"object" : "Account",
"data" : { "objectIdList" : [ "001234567891234","001234567891235","001234567891236" ] } // only Ids are required
};
bridge.sendRequest(request, function (responseData) {
console.log('Javascript got its response: ' + responseData);
if (results.type === "deletebatchResponse") {
var resultObject = results.data;
var wasSuccessful = resultObject.summary.success; // overall success encoded here as "TRUE" or "FALSE"
var resultIds = Object.keys(resultObject.results); // results are encoded as a dictionary, keyed by object id
for (var objId in resultIds) { // results is a dictionary of objects with a success flag, object id, and error message (if unsuccessful)
var objectResult = resultObject.results[objId];
if (objectResult.success === "FALSE") { // success encoded here as "TRUE" or "FALSE"
alert('This object failed to delete: ' + objectResult.objectId);
}
}
} else if (results.type == 'error') {
errStr = results.data;
alert('A problem occurred:\n' + errStr);
} }); |
Sample response:
Code Block |
---|
{ "type": "deletebatchResponse", "object": "Account", "fieldName": null, "data": { "summary": { "success": "FALSE" }, "results": { "001234567891234": { "objectId": "001234567891234", "success": "TRUE", "error": "" }, "001234567891235": { "objectId": "001234567891235", "success": "FALSE", responseData.type === 'error') { // when there is an error, the responseData will contain the error message alert('There was an error submitting your read request to Pulsar. ' + responseData.data); } else { // when the request succeeds, the responseData will contain an array of the matching objects const records = responseData.data; if (records.length > 0) { alert(`We found ${records.length} records matching Name = John Doe Industries`); alert(`The Id of the first record is ${records[0]['Id']}`); } } }); |
Response Structure
If the request fails,
responseData
will contain an error message:Code Block language json { "type": "error", "object": "Account", "data": "Error message here" }
If the request succeeds,
responseData.data
will contain an array of matching objects:Code Block language json { "type": "readResponse", "object": "Account", "data": [ { "Id": "001XYZ123456789", "Name": "John Doe Industries", "Industry": "Technology", ... (remaining field: value pairs) }, ... (other matched SObjects) ] }
Create
Description
The Create API allows you to create a new Salesforce object by specifying field names and values in the data
portion of the request. This is functionally equivalent to saving a new record via the Pulsar native user interface.
By default:
If a field validation or record creation error occurs, Pulsar’s record creation screen will be displayed to allow user intervention.
You can override this behavior using optional arguments. (see below)
Request Parameters
type
(string, required) – Must be set to"create"
to indicate a create operation.object
(string, required) – The name of the Salesforce SObject to create (e.g.,"Account"
,"Contact"
).data
(object, required) – A key-value mapping where:Keys represent field names on the specified
object
.Values represent the field values to be assigned.
args
(object, optional) – Additional options to control the behavior of the API:allowEditOnFailure
(string, optional, default"TRUE"
)If
"TRUE"
(default), Pulsar’s record creation screen is displayed when errors occur.If
"FALSE"
, errors will prevent creation without user intervention.
skipLayoutRequiredFieldCheck
(string, optional, default"FALSE"
)If
"TRUE"
, the API skips checking for fields marked as required in the Salesforce layout.
Note |
---|
Concurrency Restrictions and Side Effects
Furthermore, this API will have the following effects (if these features are enabled):
|
Example Request
The following request creates an Account
record with a Name
and Phone
, while preventing user intervention in case of failure:
Code Block | ||
---|---|---|
| ||
var request = {
"type": "create",
"object": "Account",
"data": { "Name": "John Doe Industries", "Phone": "867-5309" },
"args": {
"allowEditOnFailure": "FALSE", // Prevents UI intervention if an error occurs
"skipLayoutRequiredFieldCheck": "FALSE" // Ensures all layout-required fields are validated
}
};
bridge.send(request, function (responseData) {
alert('Received create response: ' + JSON.stringify(responseData));
});
|
Response Structure
If the request fails,
responseData
will contain an error message:Code Block language json { "type": "error", "object": "Account", "data": "Error message here" }
If the request succeeds,
responseData.data
will contain the Id of the newly created object:Code Block language json { "type": "createResponse", "object": "Account", "data": "001XYZ123456789", }
Update (Single Record Only)
Description
The Update API modifies an existing Salesforce object using field names and values specified in the data
portion of the request. This is equivalent to updating a record via the Pulsar native user interface.
Only one record can be updated per request.
The
Id
field is required to identify the record to update.By default, if the update violates Salesforce layout-required fields, the request may fail unless overridden (see below).
Request Parameters
type
(string, required) – Must be set to"update"
to indicate an update operation.object
(string, required) – The name of the Salesforce SObject to update (e.g.,"Account"
,"Contact"
).data
(object, required) – A key-value mapping where:Id
(string, required) – The unique Salesforce ID of the record to update.Other fields represent the values to update.
args
(object, optional) – Additional options to control update behavior:skipLayoutRequiredFieldCheck
(string, optional, default"FALSE"
)If
"TRUE"
, the API skips checking for fields marked as required in the Salesforce layout.
Note |
---|
Concurrency Restrictions
Additional EffectsIf the following features are enabled, updating a record will also:
|
Example Request
The following request updates an Account
record, modifying its Name
and Phone
:
Code Block | ||
---|---|---|
| ||
var request = {
"type": "update",
"object": "Account",
"data": {
"Id": "001234567891234", // Required: Specifies which record to update
"Name": "John Doe Industries, Inc",
"Phone": "(555) 867-5309"
},
"args": {
"skipLayoutRequiredFieldCheck": "FALSE" // Ensures all layout-required fields are validated
}
};
bridge.send(request, function (responseData) {
alert('Received update response: ' + JSON.stringify(responseData));
});
|
Response Structure
If the request fails,
responseData
will contain an error message:Code Block language json { "type": "error", "object": "Account", "data": "Error message here" }
If the request succeeds,
responseData.data
will contain the Id of the updated record:Code Block language json { "type": "updateResponse", "object": "Account", "data": "001XYZ123456789" }
Delete (Single Record Only)
Description
The Delete API removes an existing Salesforce object using the Id
field to identify the record. This is equivalent to deleting a record via the Pulsar native user interface.
Only one record can be deleted per request.
If the record does not exist or the
Id
is invalid, the request will fail.
Note |
---|
Concurrency Restrictions
Additional EffectsIf the following features are enabled, deleting a record will also:
|
Example Request
The following request deletes an Account
record with the specified Id
:
Code Block | ||
---|---|---|
| ||
var request = {
"type": "delete",
"object": "Account",
"data": { "Id": "001234567891234" } // Required: Specifies which record to delete
};
bridge.send(request, function (responseData) {
alert('Received delete response: ' + JSON.stringify(responseData));
});
|
Response Structure
If the request fails,
responseData
will contain an error message:Code Block language json { "type": "error", "object": "Account", "data": "Error message here" }
If the request succeeds,
responseData.data
will contain the Id of the now deleted object:Code Block { "type": "deleteResponse", "object": "Account", "data": "001234567891234", }
Batch Delete
Description
The Batch Delete API allows you to delete multiple Salesforce records in a single request using an array of object IDs. This is equivalent to sequentially deleting records via the Pulsar native user interface, but with improved efficiency.
Only records specified in the
objectIdList
array will be deleted.The response provides a success status for each individual record.
If some deletions fail, the response will include error details.
Note |
---|
Concurrency Restrictions
Additional EffectsIf the following features are enabled, deleting records will also:
|
Info |
---|
|
Example Request
The following request attempts to delete three Account
records:
Code Block | ||
---|---|---|
| ||
var request = {
"type": "deletebatch",
"object": "Account",
"data": {
"objectIdList": [ "001234567891234", "001234567891235", "001234567891236" ] // Required: List of record IDs to delete
}
};
bridge.send(request, function (responseData) {
console.log('Received batch delete response:', responseData);
if (responseData.type === "deletebatchResponse") {
var resultObject = responseData.data;
var wasSuccessful = resultObject.summary.success; // "TRUE" if all deletions succeeded, "FALSE" otherwise
var resultIds = Object.keys(resultObject.results);
resultIds.forEach(function(objId) {
var objectResult = resultObject.results[objId];
if (objectResult.success === "FALSE") { // Check if deletion failed
alert(`Failed to delete record: ${objectResult.objectId}. Error: ${objectResult.error}`);
}
});
if (wasSuccessful) {
console.log('Batch delete successful!');
}
} else if (responseData.type === "error") {
alert('A problem occurred:\n' + responseData.data);
}
});
|
Response Structure
If the request fails completely,
responseData
will contain an error message:Code Block language json { "type": "error", "object": "Account", "data": "Error message here" }
If the request succeeds partially or fully,
responseData.data
will contain a summary success flag and individual results for each record:Code Block language json { "type": "deletebatchResponse", "object": "Account", "data": { "summary": { "success": "FALSE" // "TRUE" if all deletions succeeded, "FALSE" if any failed }, "results": { "001234567891234": { "objectId": "001234567891234", "success": "TRUE", "error": "" }, "001234567891235": { "objectId": "001234567891235", "success": "FALSE", "error": "delete failed - Error occurred during object delete" }, "001234567891236": { "objectId": "001234567891236", "success": "TRUE", "error": "" } } } }
Local SQL Queries
Select (Read-Only Local Query)
Description
The Select API allows advanced users to execute custom read-only queries using Pulsar's built-in database engine. This API provides flexibility for querying data using a raw SQL-like syntax, enabling more complex filtering conditions than the standard Read API.
Supports fully custom
SELECT
statements within the Pulsar environment.Executes locally, meaning results are derived from Pulsar’s database cache.
Read-only operation—no data modification is performed.
Request Parameters
type
(string, required) – Must be set to"select"
to indicate a selection query.object
(string, required) – The name of the Salesforce SObject to query (e.g.,"Account"
,"Contact"
).data
(object, required) – Contains:query
(string, required) – A raw SQL-like query string to execute.
Example Request
The following request selects all Account
records where the Name
field contains "hello"
:
Code Block | ||
---|---|---|
| ||
var request = { "type": "select", "object": "Account", "data": { "errorquery": "delete failed - Error occurred during object delete"SELECT Id FROM Account WHERE Name LIKE '%hello%'" }, }; bridge.send(request, function (responseData) { if (responseData.type === "001234567891236error":) { alert("An error occurred: " + responseData.data); } else { "objectId": "001234567891236", var records = responseData.data; "success": "TRUE",console.log(`Retrieved ${records.length} records.`); if (records.length > 0) { "error": "" alert(`First record }Id: ${records[0].Id}`); } } } |
Local SQL Queries
Select (read-only local query)
Info |
---|
The select request allows advanced users to create an arbitrary select query using Pulsar's built in database engine. |
Code Block |
---|
var request = { ); |
Response Structure
If the request fails,
responseData
will contain an error message:Code Block language json { "type"
...
: "
...
error",
...
"object"
...
: "Account", "data": "Error message here" }
If the request succeeds,
responseData.data
will contain an array of matching records:Code Block language json { "type": "selectResponse", "object": "Account",
...
"
...
data"
...
:
...
[
...
...
...
...
...
{ "Id": "001XYZ123456789" },
...
...
...
...
{ "Id": "001XYZ987654321" }
...
Update (local update query)
...
] }
Update (Local Update Query)
Note |
---|
Warning: Use with CautionWe strongly recommend using the standard CRUD Update API (see above) whenever possible. The |
Code Block |
, which can have significant risks if not used carefully. Caveat Programmer!updateQuery is an advanced request for custom/batch updates, and extreme care should be taken with its useDoes not perform processing of ValidationRules for the record(s) in question Will not re-calculate and save formula fields for the record(s) in question Using
❌ No validation rules are enforced for updated records. It is possible to write values to the Db offline that will not sync cleanly to Salesforce or may damage your Salesforce instance when synced It is possible to write values to the Db that will break functionality across the Pulsar app |
Info |
---|
When Pulsar is in online mode, the |
records are not recalculated. |
Description
The Update Query API performs a direct batch update on the local Pulsar database using a raw SQL-like query.
Bypasses standard Salesforce validation and field recalculations.
Offline mode: Updates are stored locally and synced later.
Online mode: Changes are pushed to Salesforce, but Salesforce errors are not immediately reflected in the API response.
Response always indicates local database success or failure, even if the sync to Salesforce fails.
Request Parameters
type
(string, required) – Must be set to"updateQuery"
to indicate a raw update query.object
(string, required) – The name of the Salesforce SObject being updated (e.g.,"Account"
,"Contact"
).data
(object, required) – Contains:query
(string, required) – A rawUPDATE
SQL-like statement to execute.
Example Request
The following request updates all Account
records where OpportunityCount__c > 0
, setting ActiveCustomer__c
to "TRUE"
:
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: { send(request, function (responseData) { alert('Received update query response: ' + JSON.stringify(responseData)); }); |
Response Structure
If the local update succeeds,
responseData
will indicate"success"
, even if syncing to Salesforce later fails.If Salesforce sync fails, errors will be reported separately inside the success response.
Example: Successful Local Update with Salesforce Error
Code Block | ||
---|---|---|
| ||
{ "type": "updateQueryResponse", "object": "Account", "data": "success", "errors": [ { "errorCode": "ENTITY_IS_LOCKED", "message": "This record is locked. If you need to edit it, contact your admin." } ] } |