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
Manish.SinghManish.Singh 

Calulate Case Age

Hello guys,
Can anyone help me to calculate case age in hours using following business days in apex?
User-added image
one condition should be concern when calulating, when case is open calculation must go on but when case is closed it should stop calulating age.
VinayVinay (Salesforce Developers) 
Hi Manish,

Check below reference that can help you to build formula for case age.

https://help.salesforce.com/s/articleView?id=000341512&type=1
https://help.salesforce.com/s/articleView?id=000329632&type=1
https://salesforcescool.blogspot.com/2021/05/calculate-case-or-task-age-using-formula.html

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Manish.SinghManish.Singh
appreciate your effort Vinay but I need this in apex, not in the formula
Thank you