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
billing badgebilling badge 

help on scheduling a class

Hi All,

Need a help,

1) want to run the class from 8 Am to 2 PM everyday
2) and want to run the class from 5PM to 3 AM Everyday.
any ideas on cron expression. 

Thanks,
Billing
    
AbhishekAbhishek (Salesforce Developers) 
The below trailhead will help with your requirement,

https://trailhead.salesforce.com/content/learn/modules/asynchronous_apex/async_apex_scheduled

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
mukesh guptamukesh gupta
Hi bage,

As per your requirment, we can set only starting time of scheduler , we can't decide end time of job beucase it's depand on resourse avalibility and record size.
So i think you should set only start time.

If you need any discussion please let me know.

If this solution is usefull for you, Please mark as a Best Answer to help others.


Regards
Mukesh




  
gaurav gupta 253gaurav gupta 253
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String sch = '20 30 8 10 2 ?';

You can mention only start time..