The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Update

Updates individual objects or batches of objects.

NameData TypeDescription
ObjectsAPIObject[]A collection of objects.
OptionsUpdateOptionsOptionally specifies processing options.
OverallStatusStringSpecifies the overall status of the request.
RequestIDStringA unique identifier for the request.

The Update method allows objects to be updated-individually or in batches. Multiple object types can be updated with one call. Objects are created in the order they are added to the APIObject array.

  • UpdateOptions - An UpdateOptions instance is required for this parameter, but you don't need to define properties for the instance.

  • APIObjects - An array of objects to be acted upon. The objects are acted on in the order they have been added - first in, first out. This array can hold different object types. Therefore, complex interactions like updating an email, a list, and an email can be accomplished in one call.

  • RequestKey - This parameter contains a string value containing an output variable of the key of the request. By default, this value is a GUID.

  • OverallStatus - This parameter returns a string value containing the overall status of the request. Valid status values include:

    • OK - Status code stating that all objects were updated successfully.
    • Has Error - Valid for Update calls with multiple APIObject objects, this status code states that some of the operations failed, while some succeeded.
    • Error - This status code states that all update operations failed during validation or processing.

Don't use the Update method to create objects. Trying to create objects using the Update method causes the overall status to not be Has Error or Error.

  • UpdateResult - An array of objects holding a list of return values. The objects are returned in the order acted upon: first in, first out. This array contains one UpdateResult object per input APIObject.