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
Nate Lindo 2Nate Lindo 2 

subtracting dates on an object and incorporating business hours

I have a field on the cases object with the following formula:
IF(
ISBLANK(Initial_Email_response_with_time__c ),
NULL,TEXT(
FLOOR(Initial_Email_response_with_time__c - CreatedDate )
) & " Days " &
TEXT(
ROUND(MOD((Initial_Email_response_with_time__c - CreatedDate )*24,24),0)
) &" Hours " &
TEXT(
ROUND(MOD((Initial_Email_response_with_time__c - CreatedDate )*1440,60),0)
) &" Minutes ")

Is there anywhere to incorporate the business hours? The objective of this field to report on cases open and making sure they are responded to within 4 hours but when it comes to off hours and weekends, it wont work.
Shashikant SharmaShashikant Sharma
Hi Nate,

You wont be able to utilize business hours in formula , you have to do calcualations using Apex Code to utilize Business Hours record.

Thanks
Shashikant
 
Nate Lindo 2Nate Lindo 2
Okay good to know, thank you!
Shashikant SharmaShashikant Sharma
Please let me know if you face issues implementing it with Apex Class.
Nate Lindo 2Nate Lindo 2
I am not familiar enough with creating an apex class to attempt it.
Shashikant SharmaShashikant Sharma
I would say just start with it and let me know if you face any issues.