Background Processes

As an administrator of Billing Central, you can choose whether some processes use Batch Apex or Queueable Apex to process records in the background. The Use Queueable options in the Background Settings custom setting determine which method a process uses. See Background Process Settings.

Background Processing Options Available for Each Process
Process Batch Apex Queueable Apex
Activate Contracts Tick Tick
Amend Prices Always runs using Queueable Apex.
Apply Change Requests Always runs using Queueable Apex.
Assign Proration Tick Tick
Billing Tick Tick
Complete Billing Document Tick Batch Apex is always used when completing from the list view.
Convert Invoice Tick Batch Apex is always used when converting from the list view.
Discard Billing Document Tick Tick
Expire Contract Tick Tick
Generate Schedules Tick
Renew Contracts Tick Tick
Tax Breakdown Creation Tick
Update Total Billed

Tick

Batch Apex is always used for updating total billed when completing billing documents from the list view.

Batch Apex

If using Batch Apex, a single Batch Apex job is created. If validation errors occur while that job is running, the job is retried once, however records that exceed Salesforce limits are not retried. For Billing Central processes that can use Batch Apex, you can set the Scope Size. See Background Process Settings. For more information, see the Salesforce Help.

Diagram representing the linear way in which records are processed using Batch Apex.

Queueable Apex

You can choose Queueable Apex if you want records to be processed in parallel chains. If you have a large number of contracts to be billed, using Queueable Apex may increase the number of contracts you can process per hour. This depends on Salesforce resource allocation and the way in which objects have been customized on your Salesforce org. For Billing Central processes that can use Queueable Apex, you can set the Queue Size and the Scope Size. See Background Process Settings. For more information, see the Salesforce Help.

Diagram representing the way in which records are processed in parallel queues when processed using Queueable Apex.

Depending on your Salesforce org, this might be the optimal method for processing large numbers of records in Billing Central. If you encounter performance problems, use Batch Apex.

Notes:

In general we expect best performance to be achieved by setting Scope Size as high as possible subject to the Salesforce Execution Governors and Limits, and setting Queue Size to the same value as Scope Size. We do not recommend setting Queue Size lower than Scope Size.

Entering a lower Queue Size will create more parallel queueable jobs. Records will be processed in parallel up to the maximum number of jobs that Salesforce can process at the same time. Be aware that lowering Queue Size too far will split the work up so much that the fixed cost of starting each queueable will slow performance down rather than improve it.

Entering a higher value for Scope Size will result in a larger number of documents being processed in one go. This is subject to the Salesforce Execution Governors and Limits. Errors might occur if you enter a value which causes the Salesforce limits to be exceeded. See the Salesforce Help for more information.

If you have a large number of contracts to be billed, using Queueable Apex might increase the number of contracts you can process per hour. This depends on Salesforce resource allocation and the way in which objects have been customized on your Salesforce org. If you encounter performance problems use Batch Apex.

A Scope Size setting only has an effect if it is lower than its corresponding Queue Size setting.