By Prem Tiwari. Updated on
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);
Sharing is caring!