Scheduling Dunning Run Job
If your business produces large numbers of invoices, you may require to start the dunning run automatically on a regular basis. To this end, you set up a corresponding job for the corresponding Apex class ScheduledDunningRun
to produce dunning reminders at regular intervals.
Info
To avoid inapplicable dunning reminders, JustOn recommends to have the dunning run job executed after registering payments (payment entry import in JustOn Billing & Invoice Management or settlement when integrating with JustOn Cash Management).
Handling recommendations
Once the dunning run job is scheduled, it executes at the specified time, creating a new dunning run and new dunning reminders for all configured dunning levels.
Make sure to check the produced dunning reminders on a regular basis, too. JustOn recommends to finish or delete new dunning reminders as soon as possible. There should be no draft dunning reminders left at the end of the job's execution interval.
Note
The dunning run job always involves all configured dunning levels. It does not support additional parameters. All conditions and setting must be defined in the dunning levels.
That is, you set up the job directly for for the corresponding Apex class ScheduledDunningRun
. For details, see Scheduling Concepts.
To schedule the dunning run job, you can use either JustOn's Scheduled Jobs page or Salesforce's Schedule Apex functionality. For details, see Scheduling a Job.
Via JustOn's Scheduled Jobs page:
-
Open the Scheduled Jobs page.
Use the following URL
https://login.salesforce.com/apex/ONB2__JobsSetup
, or, if you are already logged in, appendapex/ONB2__JobsSetup
to your org's domain name.You can access the Scheduled Jobs page via the JustOn configuration app ( > JustOn Configuration > Jobs Setup).
-
From the
Apex Job
drop-down list, selectDunning Run Job
.The
Job Name
field is automatically set toScheduledDunningRun
. -
From the
Start Time
drop-down list, select the preferred execution time. - Optionally, edit the displayed cron expression to adjust the execution time.
-
Click Schedule.
This sets up the dunning reminder generation to be executed at the specified time.
Info
From the Scheduled Jobs page, you can also run the job immediately.
Via Salesforce's Schedule Apex functionality:
-
Click to enter Setup, then open Apex Classes.
In Salesforce Lightning, navigate to Custom Code > Apex Classes.
In Salesforce Classic, navigate to Develop > Apex Classes.
-
Click Schedule Apex on top of the list.
-
Specify the details as required.
- Job Name
- Apex Class:
ScheduledDunningRun
- Frequency:
Weekly
orMonthly
(with an according weekday or day of month setting) - Start
- End
- Preferred Start Time
-
Click Save.
This sets up the dunning reminder generation to be executed at the specified time.
For more details about job scheduling, see Scheduling a Job in the JustOn documentation and Schedule Apex in the Salesforce Help.