function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sarma DuvvuriSarma Duvvuri 

cron expression

Hi All,

I want to run the batch from monday to friday in between 9 AM to 5 PM for every one hour. Please tell me how to proceed.

Thanks,
Sarma
SandhyaSandhya (Salesforce Developers) 
Hi,

You can try something like below
apexScheduledJob j = new apexScheduledJob ();
String sch = '0 17 9 ? * MON-FRI *'
System.schedule('My Job', sch, j);


Check with below blog which has the explanation for the same.

https://salesforce.stackexchange.com/questions/16841/apex-cron-job-command-to-schedule-an-apex-job-to-run-every-4-hours-daily/189036

https://www.forcetalks.com/blog/using-cron-expression-in-salesforce/
 
You can validate your expression from below link.

http://www.cronmaker.com/
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya
 
 
Selvaganesh Ilango 6Selvaganesh Ilango 6
Hello All,

This tool must get the job done quickly.
http://radix2.tech/tools/sfdc-batch/

Thanks
Selva