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);
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:
|
, – * / |
Day_of_week | 1–7 or the following:
|
, – * ? / L # |
optional_year | null or 1970–2099 | , – * / |