Beginner Dev

Dev Tip 5: Execute schedule batch jobs in salesforce to run every 30 mins/15mins

Pinterest LinkedIn Tumblr

In this post, We will try to understand how to schedule a batch job in Salesforce to run every 30 mins. Salesforce User interface gives us the ability to only Schedule Apex classes on an hourly basis. If we want to schedule our batch class to run every 30 mins or to run at 12:30/1:30/2:30/3:30  this is not possible from user interface.

We could achieve the desired functionality from developer console. Run the below command to schedule the job to run for every 30 mins

Command for 30 mins:

system.schedule(‘AccSched30min’, ‘0 30 * * * ?’, new AccountSchedule());

Command for 15 mins:

system.schedule(‘AccSched15min’, ‘0 15 * * * ?’, new AccountSchedule());

Command for 45 mins:

system.schedule(‘AccSched45min’, ‘0 45 * * * ?’, new AccountSchedule());

Command for 10 mins:

system.schedule(‘AccSched10min’, ‘0 10 * * * ?’, new AccountSchedule());

From Schedule Jobs check for the jobs that were scheduled.

Write A Comment