You need to sign in to do that
Don't have an account?
The new Learner
How to find out the business day between two dates using Apex class
Hi Experts,
I want to find out the business day between two dates need to exclude holidays and weekends. Can anyone help me pls
I want to find out the business day between two dates need to exclude holidays and weekends. Can anyone help me pls
You have to use BusinessHours to achieve this See https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_businesshours.htm
Try using the method isWithin(businessHoursId, targetDate) because Holidays are included in the calculation
Please refer https://salesforce.stackexchange.com/questions/155113/add-days-to-created-date-excluding-weekend-and-holidays for sample code
If this answers your question, please mark this as best answer so that it can help others in the community. Thank You!
Anudeep