Automating Status Changes
How to update course statuses based on start and end dates
You'll want to make sure your course statuses are automatically updated based on completion criteria. Here's how it works.
The system searches for courses with status of Scheduled but whose start date is today. When a course matches these conditions, the system changes its status from Scheduled to Active.
The system also searches for courses with status of Active but whose end date is yesterday. When a course matches these conditions, its status is changed to Completed.
To configure this, follow these steps:
Go to Setup.

Setup
Then search for Jobs in the Quick find search bar, and click on Scheduled Jobs.
Scheduled Jobs
If no Scheduled job is set to CourseStatuschanging, it must be created as follows:
In the Quick find search bar, type in Custom Code, and click on Apex Classes. Then click on Schedule Apex.

Schedule Apex
- Give the job a name, e.g., Course Status Update.
- Select the Apex Class
CourseStatusBatchSchedule.

Course Status Batch Upload
- Set the frequency to Weekly and mark all days of the week.
- Define a Start date and an End date as well as the Preferred Start Time.
- Click Save.
Schedule Apex filled
This configuration means that a Batch Process will run every day at the defined Preferred Start Time, from the defined Start date up to the defined End date.
Updated about 1 year ago
