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
sumit dsumit d 

trigger to measure the time between first response time and when the case is opened

hi all,

     I need to create a way to capture when the first response. I then need to measure how long time between when the Case was opened and       when it was first responded. 

I created two fields: 
Time_to_First_Response__c 
First_Response__c

I need to capture the first response and measure the time to first response in a trigger . 

First Response is defined as when the case owner user makes any edit to the case or logs an activity against the case. 

Time to First Response Calculation: 
I need to NOT include when office is closed (nights, weekends, holidays) in calculation. 
VamsiVamsi
Hi,

1.Create a chekbox on case and make the default value as unchecked.
2. create a workflow rule on case with criteria as created and evertime its edited 
3. set the criteria as checkbox = false 
4. create a workflow field update action on Case and update the First_Response__c with the current date time and add another field update to make the check box = true. - by this way it capture the first response only.
5.Time_to_First_Response__c  can be calculated by creating a new formula field (subtract first response date time - case created date time).

Hope this helps ..!!!
sumit dsumit d
how can i do this with the help of trigger?
any suggestions?
Regards