Skip to content

How to customize batch chains?

In some business models, the standard batch chains as shipped with JustOn may not meet your requirements.

Using the custom setting Custom Batch Chain, you can override existing batch chains like, for example, INVOICERUN. The setting allows for including or excluding batch Apex classes and modifying their execution order.

Each Custom Batch Chain setting specifies the following mandatory information:

Field Type Description
Name Text Specifies the name of the batch chain to be modified.
Use one Custom Batch Chain setting record for each batch chain.
Batches Text (255) Comma-separated list of batch Apex classes that are to be processed within the customized batch chain.

Standard Batch Chains

Batch Chain Apex Classes
INVOICERUN TransactionBuilderBatchHelper
TransactionalInvoiceRunBatchHelper
BatchInvoiceRun
OpportunityInvoiceRunBatchHelper
GenericInvoiceRunBatchHelper
MarkAsBilledBatchHelper
BatchAssignBalances
CreateInstallmentsBatchHelper
BuildTransactionTablesBatchHelper
FINALIZEINVOICE BatchExternalTaxRetriever
BuildTransactionTablesBatchHelper
SettleInvoicesBatchHelper
BatchFinalizeInvoice
BatchAssignBalances
BatchExternalTaxRetriever
CreateInstallmentsBatchHelper
BatchPdfGenerate
TransferToPaymillBatchHelper
TransactionCsvBatchRenderHelper
INVOICEEMAILQUEUE BatchPdfGenerate
BatchInvoiceEmailQueue
EMAILJOB BatchInvoiceEmail
BatchDunningEmail

Configuring Custom Batch Chain

To override a batch chain, you define a new Custom Batch Chain setting:

  1. In Setup, 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 Custom Batch Chain.
  3. Click New.
  4. Specify the details as necessary.
    • Name: The name of the batch chain to be modified
    • Batches: The batch Apex classes to be processed
  5. Click Save.

Info

Create an individual Custom Batch Chain setting record for each batch chain to be modified.

Custom Batch Chain example - INVOICERUN

You have configured the generic invoice run. When the invoice run is finished, you want all invoices to be finalized and sent out via email automatically without user interaction. Use the following setting:

FieldValue
NameINVOICERUN
BatchesGenericInvoiceRunBatchHelper, BatchAssignBalances, SettleInvoicesBatchHelper, BatchFinalizeInvoice, BatchPdfGenerate, BatchInvoiceEmailQueue, BatchInvoiceEmail