• 1Installation
  • 2Preliminary Knowledge
  • 3Hello World Job
  • 4Cron Expression Jobs
  • 5Repeating Jobs
  • 6Job Management

Job.apex

  • Docs
  • Tutorials
Getting started with Job.apex

Cron Expression Jobs

Job.apex provides full support to Salesforce Apex scheduled job cron expressions.

new Job('test', new CustomJob())
    .everyDay()
    .atHour(8)
    .schedule();
// Schedule a job that runs at 8:00 everyday
new Job('test', new CustomJob())
    .betweenDaysOfWeek('Mon', 'Fri')
    .atHour(8)
    .schedule();
// Schedule a job that runs at 8:00 every week day
new Job('test', new CustomJob())
    .fromDay(1)
    .everyDays(2)
    .atHour(8)
    .schedule();
// Schedule a job that runs at 8:00 every other day from day 1
new Job('test', new CustomJob())
    .inMonth('May')
    .on2nd('Sun')
    .atHour(8)
    .schedule();
// Schedule a job that runs at 8:00 on the second Sunday of May
new Job('test', new CustomJob())
    .onLastWeekdayOfMonth()
    .atHour(8)
    .schedule();
// Schedule a job that runs at 8:00 on the last week day of every month
new Job('test', new CustomJob())
    .inMonth('Sept')
    .onNearestWeekday(20)
    .atHour(8)
    .schedule();
// Schedule a job that runs at 8:00 on the nearest week day of 9/20
Done