SFDC Add Schedule

Posted by ExiaHuang on March 29, 2017

How to add Schedule job on sfdc using apex code.

1
2
3
4
String cronStr1 = '0 0 1,3,5,7,9,11,13,15,17,19,21,23 * * ? *';
SchedulerClass sch = new SchedulerClass();
String jobID = system.schedule('Set your sfdc job name', cronStr1, sch);
system.debug('jobID---->'+ jobID);