Salesforce allows you to configure Organization Business Hours to select the days and hours that your support team is available.
View your company's business hours by navigating to Setup | Company Profile | Business Hours. Review this article on Setting Business Hours in Salesforce for more information.
When Business Hours is selected from the General Setup section of setup, as shown below, Case Flags will exclude the time elapsed outside of your company’s normal hours of operation.
When using Business Hours with Case Flags, be sure to include the appropriate Business Hours fields in your page layouts, reports, workflow rules, etc. Business Hours fields will contain either the words "business hours" in the label for each or the letters "(BH)".
Once enabled, Case Flags will recognize your organization's business hours settings and apply them for each feature throughout the package. No additional case-specific setup or configuration is required.
Note: Case Flags comes packaged with a special batch job used to help calculate aging for the Business Hours option. The user configuring this setting on the Setup Wizard will be set as the running user for the batch job and will require a license to Case Flags.
- It is recommended that an automated user with the System Administrator profile be set as the running user for this batch job.
- In the event the running user is deactivated, please perform the following steps to reset the batch job.
- Log in to Salesforce as the user you'd like to run the batch job as.
- Navigate to Setup > Installed Packages > Configure next to Case Flags.
- Once on the Setup Wizard, ensure that Business Hours is currently selected.
- Click the bubble next to Standard Hours and wait 5 seconds.
- Reselect Business Hours and click Save at the top of the page.
- Navigate to Setup > Jobs > Apex Jobs and ensure the job with Apex Class name "BusinessHoursBatch" was submitted.