Monday, 19 June 2017

Salesforce Essentials - 27(Call from developer console to batch class and Schedule Batch class)



Steps to call batch class and  Schedule Batch class from Developer Console - 

 




In order to run batch process, you need to use
Database.executeBatch() method.

accountBatch btch = new accountBatch();
Database.executeBatch(btch); 

accountBatch - is your Salesforce Batch Class .







You can schedule this class for a particular day and any specified time at which the class can be run. Using this declarative way, the highest frequency we can have is once per day within Salesforce and not more than that. 

With the system.schedule we pass parameters:
system.schedule (Name_of_job, Time_for_scheduling_job, Schedular_class_name)


This class is scheduled to run at 12 AM, on the 31st of Dec.




You can Check the scheduled batch classes:




References :https://help.salesforce.com/articleView?id=000171199&language=en_US&type=1