Search

Thursday 1 September 2011

Custom Schedule Classes

If you ever have to shceduled a class but provide a specific custom shcedule plan run a bit of code in the System Log, similar to

string CRON_EXP = '0 30 * ? * MON-FRI';
string jobid=System.Schedule('<<any name>>',CRON_EXP, new <<name of class>>());

This will run the class every 30 mins passed the hour from Mon-Fri

Changing the 1st line with
CRON_EXP = '0 0 * ? * MON-FRI';

will run the class on the hour 

More info for specific customisation at     http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_system.htm


No comments:

Post a Comment

Note: only a member of this blog may post a comment.