Batch invoice generation in Salesforce allows users to create multiple invoices at once through the Schedule Batch Invoice tab. This is especially effective for organizations handling recurring or bulk billing.
Navigate to the Schedule Batch Invoice tab within Salesforce.
Click New Batch button.
All the fields need to be filled.
Click Save to submit the batch for invoice generation.
The Batch is now active(default).
Once activated, Salesforce will process the batch and generate invoices for all records matching the specified criteria. The generated invoices will be automatically synced to Xero.
The screenshot below is taken from a Salesforce Opportunity record as part of the batch invoice generation process. In Salesforce, batch invoices can be configured to run on set intervals such as monthly or daily, depending on your business requirements.
The Criteria Field to select Invoice (API Name) plays a critical role in determining which records are picked up during batch execution.
This field must be a Formula field.
The formula should contain a logical condition that determines whether a record qualifies for batch invoice generation.
The formula must reference the Batch Number field.
The API name of this Formula field must be entered in the Criteria Field to select Invoice (API Name) field on the batch record.
The formula field evaluates whether:
The record belongs to the current batch number, and
The invoice has not already been created for that batch.
This ensures invoices are generated only once per batch.
This field must be a Date field.
It is used to exclude records for which invoices have already been generated in the same batch.
The system checks this date field during execution to prevent duplicate invoice creation.
The API name of this Date field must be populated in the Field to exclude invoice created from the same batch (API Name) configuration.