+ Start a Discussion
World IndiaWorld India 

what is the minimum time of schedule apex

Lalit Mistry 21Lalit Mistry 21
Technically speaking there is no such limit. You can schedule apex to run every seconds too.
From Schedule Apex page UI, you can schedule apex class to run on hourly basis but by executing simple script from developer console as below, you can schedule for any time.
ApexScheduleCustomClass schClass = new ApexScheduleCustomClass();
String sch = '0 0 8 13 2 ?';
System.schedule('One Time Schedule', sch, schClass);
In the above example, ApexScheduleCustomClass is a apex class implementing the Schedulable interface and sch is cron expression to schedule the class. Details around cron expression can be found at https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
Marcelo CostaMarcelo Costa

I know It's a really OLD thread, but I hate to see wrong information... as seconds and minutes in the cron do not accept wildcards, the minimum time repetition for scheduling apex cron jobs is one hour. '0 0 * * * ?' to get more granularity, you have to schedule more jobs with the same Schedulable class.