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
Neha Dubey 25Neha Dubey 25 

Calculate Business Hours between 2 DateTime Fields on lead using Apex Trigger. Configure Business Hours in your personal org as Monday to Friday 10.00am to 06.00pm. Create one DateTime field on Lead. Calculate the difference between Lead CreatedDa

AnkaiahAnkaiah (Salesforce Developers) 
Hi Neha,

between which dates you need to calculate business hours?

Thanks!!
Shams TabrezShams Tabrez
Hi Neha,

Please go through this article. The article shows how to calculate business hours using Formula Fields and Triggers as well.
https://www.tech-vision.us/salesforce-the-number-of-business-hours-between-two-date-time-fields/

Thanks,
Tabrez​​​​​​​