1. Navigate to Salesforce Setup
2. Navigate to Flows
3. In the list of flows, click Declarative Batch Template
4. Click Save As
5. Select New Flow
6. In the Get Records elementof the new flow, select the object that the batch will run on
7. The flow must be activated before it is selectable in the Declarative Batch app
1. Navigate to Salesforce Setup
2. Navigate to Flows
3. Click New Flow
4. Select Autolaunched Flow as the type
5. Create a variable named recordIds
a. Select Text for Data Type
b. Check Allow multiple variables (collection)
c. Check Available for input
6. Use the recordIds variable to retrieve records to process in the flow with a Get Records flow element.
7. The flow must be activated before it is selectable in the Declarative Batch app.
The API name of the SObject the batch will run on. You can find this in Setup > Object Manager > search for the object by its label.
The unique batch name of this Declarative Batch.
The flow that is run in the Declarative Batch. For a flow to be selectable, it must:
· Be Active
· Have a package state of Unmanaged
· Be an Autolaunched Flow
· NOT be a Template
· Contain a text collection variable named recordIds, with Available As Input selected
Additionally, the user creating the Declarative Batch must have access to flows.
The flow that is run in the Declarative Batch. For a flow to be selectable, it must:
· Be Active
· Have a package state of Unmanaged
· Be an Autolaunched Flow
· NOT be a Template
Additionally, the user creating the Declarative Batch must have access to flows.
The number of records processed in each batch execution. For example, if your batch size is 1000, and there are 5000 records to process, there will be 5 batch executions, so each record is processed. Lower this value if encountering performance issues in your flow. This setting is for complex flows that error out processing a larger number of records in one run.
The maximum number of records processed in the batch. This applies to all batch iterations total. For example, if your batch size is 200, there are 500 records meeting the criteria of your batch, and the Limit Record Count is 300, then 300 records will be processed across two iterations of the batch job.
To create a filter, click New Filter. A filter will narrow down which records are processed when the batch runs.
The type of value that can be entered into the filter value field, such as a constant, custom setting, or date function.
Filter on a fixed, static value.
Filter on a value defined in a custom setting field.
Uses Salesforce supported date literals to filter based on a relative date or date range.
Filter based on child records. For example, filter the batch to run on accounts that have an open case or filter the batch to run on orders with a specific type of order item.
Determines if records are selected based on if all filters apply to the record, any filter applies to the record, or on custom logic defined in Filter Custom Logic.
Records are only processed by the batch if all filter criteria are met.
Records are processed by the batch if any one filter criteria is met.
Records are processed based on custom logic provided by the user in Filter Custom Logic.
Custom logic is applied in the same style as many Salesforce out of the box features, for example “1 AND (2 OR 3)”. The Custom Logic Tag number field on filters is automatically set when the Filter Logic is set to Custom Logic, so the tags can be used in the Filter Custom Logic. Not all logic tags on filters must be used, although not using a custom logic tag from the filter will render the filter inactive. Custom logic tags used in this field must exist on a filter, otherwise the batch may encounter an error.