You need to sign in to do that
Don't have an account?
VijayNi
how to execute batch apex excluding holidays
Hi Team,
How can we execute a batch apex which is scheduled to run from monday to friday and exculde any public holidays it should nor run on any public holidays.
One way is we can use schedulable class but how can we exclude a public holiday
Thanks,
Vijay.
How can we execute a batch apex which is scheduled to run from monday to friday and exculde any public holidays it should nor run on any public holidays.
One way is we can use schedulable class but how can we exclude a public holiday
Thanks,
Vijay.
Check https://salesforce.stackexchange.com/questions/32387/excluding-weekend-and-holidays-from-my-days-number that discusses similar scenario.
Use the Business Hours object(https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_businesshours.htm) to attain this functionality.
Example code:
If this information helps, please mark the answer as best.Thank you
All Answers
https://developer.salesforce.com/forums/?id=9060G000000Xeq3QAC
Thanks,
Check https://salesforce.stackexchange.com/questions/32387/excluding-weekend-and-holidays-from-my-days-number that discusses similar scenario.
Use the Business Hours object(https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_businesshours.htm) to attain this functionality.
Example code:
If this information helps, please mark the answer as best.Thank you