There are times when you may need to manually trigger the Auto-BillPay process, such as when resolving a stalled background job, recovering from skipped payments where invoices were already generated, or forcing a manual processing run outside of your standard schedule.
You can force the system to evaluate unpaid invoices and capture the associated funds by executing a manual batch script in the Salesforce Developer Console. This action safely processes the payments for eligible Auto-BillPay invoices without duplicating the invoices themselves.
Execution Steps
Log in to your Salesforce environment as a System Administrator.
Click the Gear icon in the top right corner of the screen and select Developer Console.
In the Developer Console top menu, click Debug and select Open Execute Anonymous Window (or press
Ctrl + E/Cmd + E).Clear any existing code in the window and paste the following Apex script:
Apex
JavaScriptDatabase.executebatch( new fw1.ProcessAutoBillPayBatch(), 1 );
Click the Execute button at the bottom right of the window.
Verifying the Batch Run
Once executed, the batch job will run in the background. Depending on the volume of eligible invoices, this process may take a few minutes.
To verify that the job completed successfully:
Navigate to Setup > Apex Jobs in Salesforce.
Look for the
ProcessAutoBillPayBatchclass in the list to confirm its status is "Completed."Review your outstanding recurring invoices to confirm the related Payment records have been created and the invoice statuses are updated to "Paid."
