Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
var request = {
  "type" : "read",
  "object" : "Account",
  "data" : { "Name" : "John Doe Industries" }
};
bridge.sendRequest(request, function (responseData) {
  alert('Javascript got its read response: ' + responseData);if (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']}`);
    }
  }
});

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.

...