How does a Schedule work?
In DSP, the Schedule object manages Salesforce scheduled jobs through regular Salesforce records rather than code. Creating, changing, or deleting a Schedule record schedules, reschedules, or unschedules the job. All scheduled jobs can be viewed and managed together through a list view or a query.
What You Can Schedule
A Schedule record runs one of the following:
- A Pipeline
- An Executable
- An Apex class declared with the
globalmodifier
Setting the Frequency
Each Schedule defines when its job runs. You can choose a frequency of One Day, Daily, Weekly, or Monthly, along with a preferred start time. A Schedule can also be configured to run at an interval instead — every hour, every two hours, and so on.
DSP translates these time-related settings into a cron expression and submits
it to Salesforce through the Apex Scheduler. Salesforce creates the scheduled
job and records its scheduling information in the CronTrigger
object. The user who submits the job becomes the
Scheduled User.
When the Scheduled Job Is Replaced
Changing a Schedule’s time-related settings — its frequency, preferred start time, interval, or any other field that feeds into when the job runs — changes the generated cron expression. When that happens, DSP aborts the existing scheduled job and schedules a new one in its place. The same happens when:
- A Schedule is deactivated and then reactivated
- Run Scheduled Job as Me is clicked
Deleting a Schedule record aborts its scheduled job as well. A scheduled job is
never deleted outright — Salesforce aborts it, and its
CronTrigger remains with a status reflecting that.
All other changes to the Schedule record leave the existing scheduled job untouched.
Schedule Status and Scheduled Job Status
A Schedule’s Active setting and the status of its scheduled
job are independent. An active Schedule can show a CronTrigger
whose status is DELETED or something other than
WAITING, and that is expected — the Active
setting describes the Schedule’s configuration, not the live state of the job
Salesforce is tracking.
The Scheduled Job Tab
The Schedule record has a dedicated Scheduled Job tab showing
the current CronTrigger information, including
Previous Run Time, Next Run Time, and the
Scheduled User.
DSP refreshes this information automatically whenever the Schedule is viewed inside DSP — on the Schedule record page, or in the Schedules related list of a batch Executable or Pipeline. Because the refresh writes to the record, Last Modified By becomes the user who viewed it.
This refresh is informational only. It does not alter the
CronTrigger already submitted to Salesforce, and it does not
change the Scheduled User or when the job runs.
Time Zones
Two time zones are involved, and they work differently.
The cron expression is generated in the Scheduled User’s time zone at the
moment the job is submitted. It stays fixed for as long as that
CronTrigger remains active — if the Scheduled User later changes
their time zone in their user settings, the existing job is unaffected. The
time zone in effect is shown in the
Cron Expression Time Zone field on the Scheduled Job tab.
Previous Run Time and Next Run Time are displayed in the time zone of whoever is viewing the Schedule, regardless of who created the job. A job running at 9:00 PM Eastern appears as:
- 9:00 PM to a user in Eastern Time
- 6:00 PM to a user in Pacific Time