HomeGuidesDeveloper HubRelease Notes
Get supportBook a chat
Guides
These docs are for v2.152. Click to read the latest docs for v2.208.

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.

1896

Setup

Then search for Jobs in the Quick find search bar, and click on Scheduled Jobs.

1312

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.

1544

Schedule Apex

  1. Give the job a name, e.g. Course Status Update.
  2. Select the Apex Class CourseStatusBatchSchedule.
1152

Course Status Batch Upload

  1. Set the frequency to Weekly and mark all days of the week.
  2. Define a Start date and an End date as well as the Preferred Start Time.
  3. Click Save.
1218

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.


Did this page help you?