Apex · Salesforce

Schedule managed package controllers using Developer Console

Many case we will get request to schedule apex class for specific time that is not possible through OOB functionality. So we have to us developer console to schedule job like 12:15 AM, 1.15 AM.

Not Managed controllers :

apexclassname  sc = new apexclassname();
String sched = ‘0 15 01 * * ? *’; // refer below table
System.schedule(‘UniqueName’, sched, SC);

Managed controllers :

Packageprefix.apexclassname sc = new Packageprefix.apexclassname();
String sched = ‘0 15 01 * * ? *’; // refer below table
System.schedule(‘schedulejobuniquename’, sched, SC);

Screen Shot 2016-08-26 at 11.49.19 AM

Name Values Special Characters
Seconds 0–59 None
Minutes 0–59 None
Hours 0–23 , – * /
Day_of_month 1–31 , – * ? / L W
Month 1–12 or the following:

  • JAN
  • FEB
  • MAR
  • APR
  • MAY
  • JUN
  • JUL
  • AUG
  • SEP
  • OCT
  • NOV
  • DEC
, – * /
Day_of_week 1–7 or the following:

  • SUN
  • MON
  • TUE
  • WED
  • THU
  • FRI
  • SAT
, – * ? / L #
optional_year null or 1970–2099 , – * /

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s