Creating a Batch Invoice

Creating a Batch Invoice

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.

Process Steps

    • 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.

Criteria Field to Select Invoice (API Name)

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.

🔹 Example Use Case

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.


Field to Exclude Invoices Created from the Same Batch (API Name)

  • 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.


One of the key fields visible in this process is the Mapping ID. This ID is generated during the Xero custom object mapping for Invoice creation and is used to link the data between Salesforce and Xero efficiently.

The "Email for Execution Report" field is used to specify the email address where the batch invoice execution report will be sent.


    • Related Articles

    • Batch/Bulk Invoicing limitations

      This article provides a solution about the Batch / Bulk invoicing limitations when 5000 Xero API calls per day are exceeded This can be solved by creating an optimized flow Create a flow (scheduled/triggered) using apex action ...
    • Creating a Repeating Invoice from Salesforce

      You can create a Repeating Invoice directly from any object within Salesforce. To do this, follow the steps below: Step 1: Create a Xero Custom Object Mapping Go to the Xero custom object mapping tab in salesforce. Click on [ New ] button to create ...
    • Creating a Bill (Expense) from Salesforce

      You can create a Bill (Expense) directly from any object within Salesforce. To do this, follow the steps below: Step 1: Create a Xero Custom Object Mapping Go to the Xero custom object mapping tab in salesforce. Click on [ New ] button to create you ...
    • Creating a New Invoice - from scratch

      New Invoice button is displayed on the Opportunity layout, this button will enable to create an Invoice There are two options to add products to the Invoice; you could either add any product, which are not related to the opportunity line items or ...
    • Creating < New Invoice > button on any object

      Go to the custom object nominated as your Invoice Master from the setup Select the object Go to <Buttons, Links and Actions> Select <New Button or Link> Give a label name <New Invoice> Select the option <Detail page button> In the formula section, ...