Provides access to the Declarative Batch app and all batches in the org.
Provides access to the Declarative Batch app and all batches the user has record access to.
Provides access to the Declarative Batch app and read only access to all batches the user has record access to.
The declarative batch app contains the Batch record page, where batches can be configured, connected to flows, executed, and scheduled. Access to this app is provided in all Declarative Batch permission sets.
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.
From the Declarative Batch record page, click Execute to immediately execute the batch. A preview of records that will be processed will be displayed. However, this preview does not contain all records, just 10example records. After the preview, a final confirmation is displayed before the batch is executed.
From the Declarative Batch record page, click Schedule to schedule the batch.
Schedules a batch to run once at the date and time specified.
Schedules a batch to run hourly a set number of minutes into each hour. This value must be between 0 and 59 inclusive.
Schedules a batch to run on a specified date of the week, every week, at a specified time. To run a batch daily, select all days. To run a batch weekly, select one day.
Schedules a batch to run in a specific week of the month, on a day of the week, at a specified time. For example, run a batch on the first Monday of every month. The week of the month supports the first through fourth weeks of the month.
Schedules a batch to run monthly on the same day of the month at a specified time. For example, run a batch on the first day of every month.
Note: When a batch is configured to run on a day of the month that does not exist in every month, the batch will not run in months without that many days. For example, a batch configured to run on the31st day of the month starting March 31st will not run in April. The workaround is to check the Last Day Of Month box to run the batch on the last day of every month.
Schedules a batch to run on a specified day, in a specified month, at a specified time. For example, run a batch on April 15every year.
Enter a cron expression. This is to schedule a batch to run on an interval not yet supported by the Declarative Batch scheduling wizard. See below for a tool to create a cron expression.
From the Declarative Batch record page, click Scheduled Jobs to view the batch schedule. Select the schedule(s) you would like to unschedule, and click Unschedule.