Scheduling Automatic Transaction Build
You can set up a job in order to have transactions built automatically on a regular basis. This involves the following subtasks:
- Creating a transaction filter
- Creating a batch parameters custom setting to include the transaction filter
- Scheduling the transaction build job
Creating Transaction Filter
-
Create a transaction filter with the use case
Transaction
as necessary.Note that the filter name (for example,
transaction1
) is passed as a parameter to the batch parameters setting.For details, see Creating Transaction Filter.
Creating Batch Parameters Setting
To pass the transaction filter to the transaction build process, you create a specific batch parameters setting. This setting combines the batch chain to be executed (TransactionBuilderChain
) with the filter as a specific execution argument.
-
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.
-
Click Manage in the row of Batch Parameters.
- Click New.
-
Specify the details as required.
- Name: The name for the batch parameters setting, must match the name of the transaction build job, for example
buildtransactions
- Batch Chain:
TransactionBuilderChain
-
Parameter 1: A parameter to be passed to the batch chain (pattern
parameter = value
).Assuming the transaction filter name is
transaction1
, setTransactionFilters = transactions1
- Name: The name for the batch parameters setting, must match the name of the transaction build job, for example
-
Click Save.
Scheduling Transaction Build Job
To schedule the transaction build process, you can use either JustOn's Scheduled Jobs page or Salesforce's Schedule Apex functionality. For details, see Scheduling a Job.
Via JustOn's Scheduled Jobs page:
-
Open the Scheduled Jobs page.
Use the following URL
https://login.salesforce.com/apex/ONB2__JobsSetup
, or, if you are already logged in, appendapex/ONB2__JobsSetup
to your org's domain name.You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).
-
From the
Apex Job
drop-down list, selectBatch Chain Job
. - In the
Job Name
field, specify the name of the batch parameters setting, for examplebuildtransactions
. - From the
Start Time
drop-down list, select the preferred execution time. - Optionally, edit the displayed cron expression to adjust the execution time.
-
Click Schedule.
This sets up the transaction build process to be executed at the specified time.
Info
From the Scheduled Jobs page, you can also run the batch chain immediately.
Via Salesforce's Schedule Apex functionality:
-
Click to enter Setup, then open Apex Classes.
In Salesforce Lightning, navigate to Custom Code > Apex Classes.
In Salesforce Classic, navigate to Develop > Apex Classes.
-
Click Schedule Apex on top of the list.
-
Specify the details as required.
- Job Name: The name of the batch parameters setting, for example
buildtransactions
- Apex Class:
ScheduledBatchChain
- Frequency:
Weekly
orMonthly
(with an according weekday or day of month setting) - Start
- End
- Preferred Start Time
- Job Name: The name of the batch parameters setting, for example
-
Click Save.
This sets up the transaction build process to be executed at the specified time.
For more details about job scheduling, see Scheduling a Job in the JustOn documentation and Schedule Apex in the Salesforce Help.