You need to sign in to do that
Don't have an account?
Ferdy Reyes 3
How to know how many hours in a day of BusinessHours record
I need to be able to dynamically get how many hours in a day of BusinessHours record. I need to be able to do it dynamically. How do I do it?
This is sample code of what I am doing:
Map<String,BusinessHours>bhMap = new Map<String,BusinessHours>(); ... decimal result = BusinessHours.diff(bhMap.get(key).Id,DateTime1,DateTime2); decimal numOfDay = result / (1000*60*60* x); //where x should be the num of hours per business day based on BusinesshoursIs it possible?
Please Check This Line
https://opfocus.com/blog/business-hours-calculations-with-apex/
Thank you