Zumzum Financials Knowledge Base
Overview:
To create a recurring purchase invoice in Salesforce, start by ensuring that the “Repeat this Invoice” button and the “Recurring Invoice” related list are included on the Purchase Invoice page layout. Once set up, create a new Purchase Invoice, select “Repeat this Invoice,” choose the frequency, set the start and end dates, and save the invoice as a draft. You can then monitor and manage these recurring invoices through a scheduled Apex job, which can be configured and tracked in the Setup area under Scheduled Jobs.
How to Create a Recurring Purchase Invoice
Note: Please ensure that the “Repeat this Invoice” Button and the “Recurring Invoice” Related List are on the Purchase Invoice page layout before continuing. Here is a link to the Salesforce help article on how to edit page layouts.
- The first step is to create a New Purchase Invoice, which you would like to be repeated.
- On the Purchase Invoice, select the button Repeat this Invoice.
- From the drop-down menu select the Frequency of the repeated invoice.
- Using the Start Date and End Date you can select how long the invoice will be repeated for. Depending on your “Frequency” setting this will determine how many invoices are scheduled.
- Finally, select the Status as Draft that you want the new Purchase Invoices to be created as.
You will see new draft Purchase Invoices created in the system, so please ensure you have a list view created on the Purchase Invoice Tab, so you can easily identify new draft invoices created in the system.
How to set up a Scheduled Apex Job
- Go to Setup in Salesforce,
- Enter Apex Classes in the Quick Find box and select Apex Classes
- In the list of Apex classes, select Schedule Apex.
- Enter a Job Name for your scheduled job
- Lookup and select the Apex Class ScheduledRecurringInvoices
- Specify how often the Apex class is to run.
- For Weekly—specify one or more days of the week the job is to run (such as Monday and Wednesday).
- For Monthly—specify either the date the job is to run or the day (such as the second Saturday of every month.)
- Specify the Start Date for the Apex scheduled jobs.
- Specify the End Date for the Apex scheduled jobs
- If you specify a single day, the job only runs once.
- Specify a preferred Start Time. The exact time the job starts depends on service availability.
- Click Save
How to monitor/modify an Apex Scheduled Job
To view this page, follow these steps:
- Go to Setup,
- In the quick find box, enter Scheduled Jobs in the Quick Find box, then select Scheduled Jobs.
Depending on your permissions, you can perform some or all of the following actions.
- Click Del to permanently delete all instances of a scheduled job.
- View the details of a scheduled job, such as the:
- Name of the scheduled job
- Name of the user who submitted the scheduled job
- Date and time at which the scheduled job was originally submitted
- Date and time at which the scheduled job started
- Next date and time at which the scheduled job will run
- Type of scheduled job