+ Start a Discussion
Chirag MehtaChirag Mehta 

Salesforce – Schedule Apex to run at any time interval

scheduledApexClassName m = newscheduledApexClassName();

//Seconds Minutes Hours Day_of_monthMonth Day_of_week optional_year

String sch = '0 10,20,30,40,50 * * 11 ?2009';

system.schedule('Registration Report', sch, m);


Read more at http://www.chiragmehta.info/chirag/2009/11/12/salesforce-schedule-apex-to-run-at-any-time-interval/




Any idea how I can do this one?



Benjamin LauBenjamin Lau



   Are you sure that your schedule string has the correct syntax ? 

With Winter 12, Force.IDE v23 - I can not get it to run.

It seems that only a single digit is allowed for the Minute field - what you have is full cron syntax which is not supported....



Chirag MehtaChirag Mehta

I've updated the blog post with a more optimised code to schedule apex class 10mins (change it as per your need) from now.


Let me know if you need anything else, would be happy to help and get your issue resolved.