Updating Salesforce records
Use the SalesforceRequest node to update records in the Salesforce system.
About this task
The fields of the Salesforce record to be updated must appear in the input message tree as a JSON object. Fields that do not require updating do not have to appear in the tree.
If a Salesforce ID is specified in the LocalEnvironment.Destination.Salesforce.Request.Id environment variable, the record with that Salesforce ID value is updated.
If a Salesforce ID is not specified, and an external
ID name and value are specified in the LocalEnvironment.Destination.Salesforce.Request.externalIdName
and LocalEnvironment.Destination.Salesforce.Request.externalId environment
variables, the record with that external ID is updated. If the record
does not exist, it is created. If neither a Salesforce ID nor an external
ID is specified in the local environment, but an Id
element
is found in the input message tree, that value is used as a Salesforce
ID and the record with that Salesforce ID is updated.
When the
record is updated, the input message tree is copied to the location
specified by the Output data location property of
the node, and augmented with the Salesforce ID in
an Id
element. The Salesforce Id is not provided
in the Output tree if an external Id has been specified, unless a
new Salesforce record is created (if it did not previously exist).
If an external Id is specified but the Salesforce record cannot be
found, the Salesforce record is created. This is called an upsert operation
and occurs only if an external Id has been specified.
JSON schema are supplied for a wide range of Salesforce objects, and you can use them as input and output for message maps in a Mapping node. For example, you can create the message tree to update a Salesforce Account record in a Mapping node by using the JSON schema for the Account object. For more information, see Using Salesforce models.
Procedure
Follow these steps to update a Salesforce record of a specified type (for example, an Account object):