Questions tagged [businesshours]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
2k views

formula field to exclude weekends and public holidays [duplicate]

Currently i have a formula field on case object, which will return the no. of days the case is not touched. Here, i wanted to exclude the weekend days and the public holiday (which are already created ...
3
votes
1answer
4k views

Calculating business days using BusinessHours class

Our business has a requirement to calculate a due date on a case by using the created date and adding business hours, or business days. When we calculate business days it converts the days to 24 hours ...
0
votes
1answer
970 views

We have business hours that operates 11PM to 8AM but SF have validation Start time must be earlier than end time

we have number sets of business hours of shifting of our agents. Were wondering why Salesforce.com not allowing to set the end time earlier than the start time. We would like to use the standard ...
1
vote
3answers
578 views

BusinessHour NextStartDate Method is returning start time of next business day

I have a question in BusinessHour NextstartDate method. When I am using nextStartDate(businessHoursId, targetDate) method , I am not getting the Start time of next business day. Instead it is ...
3
votes
1answer
941 views

Wrong Business Hours Calculation (Formula)

I have a formula field that calculates business hours (M- F > 09:00 AM to 5:00 PM- 8 hours) between two date time fields. i actually used exactly same formula that sf helps provided. https://...
0
votes
1answer
957 views

Need to find whether my time stamp is between the business hours

I am trying to implement SLA for Lead management. So handling all the SLA functionalities on a trigger and Apex class. I need help in getting the current time and comparing it to the defined ...
2
votes
1answer
637 views

Implement Business Hours for Email Triggers

I have a client requirement where I want to send some notification emails only during weekdays and business hours. I tried to Google this, and got to see that 'Business Hours' functionality must be ...
2
votes
1answer
1k views

BusinessHours - How to simply determine if a given day is a business day

I am simply trying to utilize different BusinessHours and the BusinessHours class to determine if a given date is within x number of business days from another date. The following are true: The hour ...
1
vote
2answers
953 views

How to calculate organisation business hours?

I need to store the organization business hours value in a field .. Is it possible to store that in a formula field ? If not , by any chance can we get the organization business hours through coding ...
2
votes
1answer
391 views

Trouble in using Business hours methods to compare business hours with specific number of hours in apex trigger

I'm trying to compare number of business hours with number of hours (bh<48) I have gone through few methods and tried the below method to get number of hours(difference between startdate and ...
0
votes
0answers
329 views

Stop Start Business Hours Timer for Custom Object

I send the data from a custom object up to a supplier (also on Salesforce) where they work it and move it from a status of New through to Approved. One of the interim statuses (not mandatory) is "...
1
vote
2answers
906 views

Using BusinessHours.add for calculating a due date in a Datetime field

I found an Apex trigger that adds 9 business hours, and I'm looking to use it to add 16 business hours to the CreatedDate field on a case and put that new value into a custom Datetime field called ...
1
vote
1answer
525 views

How could I test a BusinessHours class functionality with unit tests [duplicate]

I am trying to write a unit test for the following method, public static DateTime addBusinessDays(DateTime startDate, Integer numberOfDays, String businessHoursName){ Integer ...
3
votes
1answer
2k views

How to Associate Holiday and Business Hours in Data Import

Is there a way to insert/update Holidays and create the association to an existing Business Hour? In the UI this is achieved by clicking into the Business Hour, clicking the "Add/Remove" button under ...
0
votes
1answer
651 views

Is it Possible to calculate different business hours, based on different queues and different time zones?

Can we calculate different business hours, based on different queues and different time zones? Please Help me!!
2
votes
2answers
2k views

Formula for calculating case age excluding weekends and holidays

I need to create a formula field or apex method for calculating case age (from CreatedDate to now) excluding weekends and holidays (as defined in the case's business hours). Is it possible with a ...
5
votes
2answers
3k views

How to Calculate the Office Hours except holidays hours In Salesforce

I have the three field like below and I want to calculate the business hours but need to reduce the hour if the exist the holiday. I have write this code into the apex class and call this class form ...
1
vote
1answer
1k views

trigger using business hours to add hours for next business day

I have setup the default business hours specifying work days M-F 8 to 5pm EST and no hours on the Saturday and Sunday. When I run the trigger, the new date time is created and it does skip the ...
1
vote
1answer
587 views

How to Calculate the Out of Office Hours In Salesforce [closed]

I have the three field like below and I want to calculate the number of out of office hours. Office hour is : 9:00 to 18:00 Fields : In Time : date time field Out Time : date time field No. of ...
18
votes
1answer
3k views

Creating Holidays and Business Hours in Test Code

I have been creating a Business Hours Calculation engine in the past few weeks and have gotten some great help on a few questions I've already asked (BH in Apex, BH and Holiday Affiliation). I have ...
11
votes
1answer
3k views

Business Hours and Holiday Affiliation

I have been in the process of creating a Business Hours Engine that calculates business hours. I have used the Case Flags product and like it, but I am looking to build a custom engine so I can take ...
11
votes
2answers
5k views

Set Business Hours in Apex Test Code

I have written a class to calculate business hours for Case age in business hours. The class works great my issue is when trying to write decent test code for the class. In following testing best ...
3
votes
2answers
2k views

Business Hours In Reporting

Does anyone know of a way to use Business Hours for an Age variable within a report? I did some research and finally halted when I ran across: SF Help Article About Support Hours ...of which the ...

1
2