Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Apex

Salesforce CRON Expression Builder

Build a Salesforce System.schedule CRON expression field by field, preview the next five fire times, and start from common presets.

Cron fields

Presets

Expression + next 5 fires

Expression appears here.

Next 5 fires (browser time)

Fix the expression to preview fires.

Related dictionary terms

§

About this tool

Salesforce's System.schedule method takes a Quartz-style CRON expression with seconds, minutes, hours, day-of-month, month, day-of-week, and an optional year. The syntax is easy to get subtly wrong (the day-of-month and day-of-week fields use ? rather than *, for one). This builder gives you a labelled box per field, a set of common presets, and a live preview of the next five times the schedule would fire, so you can confirm the cadence before you paste it into Apex.

How it works

Each field is an input you can edit directly, or you can click a preset (daily at 2am, top of every hour, every weekday, and so on) to fill all fields at once. As you type, the tool joins the fields into a single space-separated CRON string, validates each field against its allowed range and the day-of-month / day-of-week ? rule, and, when the expression is valid, walks forward from the current time to compute the next five fire timestamps in your browser's local timezone. An invalid field is reported inline so you can fix it before scheduling.

When to use it
  • Building the CRON string for a new Schedulable Apex job and sanity-checking the cadence before calling System.schedule.
  • Translating a "run every weekday at 6am" requirement into a valid expression without memorising the field order.
  • Debugging a schedule that fires at the wrong time by pasting the existing expression and reading the next-fire preview.
§

Frequently asked questions

Why is the day-of-month or day-of-week field a question mark?
Salesforce (Quartz) does not let you specify both day-of-month and day-of-week at once. The field you are not constraining must be ? rather than *. The builder defaults to and validates against this rule.
Are the previewed fire times in Salesforce's timezone?
The preview is computed in your browser's local timezone for a quick sanity check. The actual job runs in the timezone of the user who scheduled it (or the org default), so allow for that offset when the two differ.
Does the year field have to be included?
No. The year is optional in Salesforce CRON expressions. Leave it off for a recurring schedule, or set it to pin the job to a specific year.