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
sieb4mesieb4me 

calculate time to respond

we want a field on case object which will pick timezone from case (can be emea, usa or apac time), look at created datetime of case and calculate the time remaining to respond to customer based on severity of case (s1, s2 or s3). We also need to ensure business hours and weekends is ignored when doing this calculation.
example if case timezone is emea and case priority is P1 and rule says customer should be replied in 1 hour then calculate response time(new field). This should consider business hours only(weekends to be ignored).

I believe this can only be done with APEX, don't think there is simple way to do this via formullas?
Any help on apex will be nice.

Thanks.
Shashikant SharmaShashikant Sharma
Yes you will require Apex, but you could do it with very simple code using BusinessHours.

Use these to develop your solution :

https://help.salesforce.com/HTViewHelpDoc?id=customize_supporthours.htm&language=en_US
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_businesshours.htm
 
sieb4mesieb4me
Thanks a lot. That does help in getting the target time but how do i calculate time, example if case is opened on friday 4pm and business hours is till 5pm then comes monday and time starts at 9am again, assuming response time is within 4 hours, so how do i find out or calcualte 1 hour from friday and 3 hours from monday so need to inform customer that response wil be given by 11am  monday.