function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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/

 

 

bikla78bikla78

Any idea how I can do this one?

 

http://community.salesforce.com/sforce/board/message?board.id=apex&thread.id=24206

Benjamin LauBenjamin Lau

Chirag,

 

   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....

 

Benjamin

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.