batch
The batch
command groups up the Salesforce API requests done by its child commands. This results in less API requests as well as faster performance with no downsides, so it is recommended to use batch
whenever doing several operations in a row.
The only limitation is that batch
can only group up operations related to records of the same object type. In other words, all create
and update
child commands must have the same value for their type
attribute, and all delete
child commands must specify IDs of records of the same object type.
Child commands
Any command can be a child of batch
, but only Salesforce operations done by child commands create, update and delete will be batched.
Examples
To use batch
, just wrap it around commands doing operations to records of the same object type. A set of operations done within a forEach is a prime example of proper batch use.
<batch><forEach value="${testObjectData}" var="data"><create type="Special_Test_Object__c"><field name="Name" value="${data.name}"><field name="Test_Type__c" value="${data.type}">