action.skip

Batch Parameters

Batch parameters control the execution behavior of a batch chain.

A batch chain is a series of several linked complex operations, which are executed sequentially on multiple records (as selected from list views) at the same time.

Common parameters

Common batch chain parameters that can be used with various batch chains include:

Parameter Possible Values Description
Interval x(d|w|m) Specifies the period to be considered by the business process (invoice run, export, etc.), where x is an integer, d=day, w=week, m=month.
Defaults to 1m.
x-y x and y are positive integers (1 .. 31), where x-y specifies a day range for a month. If x>y, then x is considered a day of the previous month.
Alignment previous, current or next Used to describe the Interval position relative to the execution time.
Interval = 1m and Alignment = next means that the considered period is the next month.
Interval = -3m (negative value) and Alignment = current means that the considered period is the current and the last two months.
Interval = 1w and Alignment = previous means that the considered period is the previous week.
If not set, defaults to previous.
ShiftDays x Optional. Usually, the time period calculation is based on the current date. This integer specifies a number of days by which the "anchor date" is to be moved backward or forward.
StartOfWeek 1 .. 7 Optional. Specifies the start day of the week, with 1 = Monday ... 7 = Sunday. Defaults to 1 if left empty.

You can define multiple batch parameters settings:

  1. Click to enter Setup, then open Custom Settings.

    In Salesforce Lightning, navigate to Custom Code > Custom Settings.

    In Salesforce Classic, navigate to Develop > Custom Settings.

  2. Click Manage in the row of Batch Parameters.

  3. Click New.
  4. Specify the details as required.

    • Name: Must match the Job Name to be set when scheduling the job
    • Batch Chain: The name of the batch chain to be executed as listed in Scheduling Concepts
    • Parameter 1..8: Define batch chain-specific execution options using the syntax parameter = value, for example, Interval = 2w or Alignment = next
  5. Click Save.

Info

The ExportChain, InvoiceRunChain and TransactionBuilderChain require parameters.

ExportChain parameters example

Export invoices of the current week:

Field Value Description
Name week_exp_schedule Must match the Job Name to be set when scheduling the job
Batch Chain ExportChain
Parameter 1 Interval = 1w Sets the invoice run period to one week
Parameter 2 Alignment = current Sets the invoice run period to the current interval period
Parameter 3 ExportSettings = OpenInvCSVExport Applies the export configuration settings OpenInvCSVExport, which must be defined in Export Settings

Use a corresponding cron expression to schedule the export for a specific day of the week. If you want, for example, to export the invoices every Saturday night at 23:00, use 0 0 23 ? * 7.

InvoiceRunChain parameters examples

Create invoices for the past two weeks:

Field Value Description
Name ir_schedule_1 Must match the Job Name to be set when scheduling the job
Batch Chain InvoiceRunChain
Parameter 1 Interval = 2w Sets the invoice run period to two weeks
With the default alignment setting (Alignment = previous), the invoice run period is the past two weeks.
Parameter 2 InvoiceDate = end-1 Sets the invoice date to the penultimate day of the invoice run period
Parameter 3 InvoiceRunFilter = MySubscriptions Sets the invoice run filter to MySubscriptions, which must be defined in Filters
Parameter 4 TransactionFilters = Cases,Orders Sets the transaction filters to Cases and Orders, which must be defined in Filters

Create invoices for the next month one week before it starts:

Field Value Description
Name ir_schedule_2 Must match the Job Name to be set when scheduling the job
Batch Chain InvoiceRunChain
Parameter 1 Alignment = current Sets the invoice run period to the current interval period
With the default interval setting (Interval = 1m), the invoice run period is the current month.
Parameter 2 ShiftDays = 7 Moves the time period calculation seven days forward (so that current actually starts one week earlier)
Parameter 3 InvoiceRunFilter = MySubscriptions Sets the invoice run filter to MySubscriptions, which must be defined in Filters
TransactionBuilderChain parameters example
Field Value Description
Name buildtransactions Must match the Job Name to be set when scheduling the job
Batch Chain TransactionBuilderChain
Parameter 1 TransactionFilters = transactions1 Specifies the transaction filter to be used
BatchBalanceExportJob parameters example
Field Value Description
Name BatchBalanceExportJob Must match the Job Name to be set when scheduling the job
Using the original batch chain name overwrites the default settings
Batch Chain BatchBalanceExportJob The name of the batch chain to be executed
Parameter 1 Period = 3 Sets the period to the past 3 days