action.skip

Custom Batch Chain

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

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.

Using the custom setting Custom Batch Chain, you can override a number of existing batch chains (see Standard Batch Chains). The setting allows for including or excluding batch Apex classes and modifying their execution order.

Be aware that overriding batch chains does not affect individual operations triggered from record detail views.

Each Custom Batch Chain setting specifies the following mandatory information:

Field Type Description
Name Text Specifies the alias 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.

Info

Customized batch chains can still be scheduled using their original name (see Scheduling Concepts).

Standard Batch Chains

Batch Chain Name Batch Chain Alias Apex Classes
InvoiceRunChain INVOICERUN TransactionBuilderBatchHelper
TransactionalInvoiceRunBatchHelper
BatchInvoiceRun
OpportunityInvoiceRunBatchHelper
GenericInvoiceRunBatchHelper
MarkAsBilledBatchHelper
BatchAssignBalances
CreateInstallmentsBatchHelper
BuildTransactionTablesBatchHelper
AutoFinalizeBatchHelper
FinalizeInvoiceChain FINALIZEINVOICE BatchExternalTaxRetriever
BuildTransactionTablesBatchHelper
SettleInvoicesBatchHelper
BatchFinalizeInvoice
BatchAssignBalances
BatchExternalTaxRetriever
CreateInstallmentsBatchHelper
BatchGetEntryPaymentLinks
BatchGetInvoicePaymentLinks
BatchPdfGenerate
TransferToPaymillBatchHelper
TransactionCsvBatchRenderHelper
InvoiceEmailQueueChain INVOICEEMAILQUEUE BatchPdfGenerate
BatchInvoiceEmailQueue
EmailJobChain EMAILJOB BatchInvoiceEmail
BatchDunningEmail
DunningRunChain DUNNINGRUN DunningRunBatchHelper

Info

The number of Apex classes included in the standard batch chain does not necessarily match the number of actually executed classes, even if you have not customized them. Depending on specific source record data or individual execution settings, JustOn can skip one or more classes or call additional ones.

Configuring Custom Batch Chain

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

  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 Custom Batch Chain.

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

    • Name: The alias of the batch chain to be modified
    • Batches: The batch Apex classes to be processed
  5. Click Save.

    This overrides the original batch chain and executes the customized batch chain when called from list views or when scheduled.

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:

Field Value
Name INVOICERUN
Batches GenericInvoiceRunBatchHelper, BatchAssignBalances, SettleInvoicesBatchHelper, AutoFinalizeBatchHelper, BatchPdfGenerate, BatchInvoiceEmailQueue, BatchInvoiceEmail
Custom Batch Chain example – DUNNINGRUN

Applying this setting automates the creation and distribution of dunning reminders.

Field Value
Name DUNNINGRUN
Batches DunningRunBatchHelper, BatchFinalizeDunning, BatchPdfGenerate, BatchDunningEmailQueue, BatchDunningEmail