By: Prem Tiwari | Last Updated:
We have recently started to share the SalseForce snippets to help of SalseForce developers. If you want to schedule any periodic event in Salesforce, then keep your attention in this tutorial as I am to share how to schedule an apex class to execute to every 30 minutes.
you can use the
System.schedule method in your apex class to schedule an event to execute.
Copy the below code and use it in your apex class to execute your apex after every 30 minutes.
batchApexMethod exeClass = new batchApexMethod();
String cronStr = '0 0,30 * * * *';
System.schedule('Job which runs at every 30th minute of hour', cronStr, exeClass);
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari