Questions tagged [businesshours]

The tag has no usage guidance.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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://...
1
vote
1answer
84 views

BusinessHours and scheduled dates

I am trying to create a payment schedule off of a input field DATE. If the date falls on a Weekend or on a Holiday then I want to move the payment date to the next open business day. I was using the ...
1
vote
1answer
35 views

Need to add only business days

In Opportunity i created a formula date field. in which i want only it take business days means like:TODAY() + ( ( ( 0.7 * ( Total_Payback_Amount__c ) ) - Total_Collected_to_Date__c ) / ...
1
vote
0answers
443 views

Create Test data within business hour and outside of business hours?

I have below code and for that I am trying to write the test classes. As per code look like Case should be created within Business hours and other condition says that, case should be created outside ...
1
vote
1answer
263 views

BusinessHours API not returning correct isWithin() value

I'm trying to use APEX BusinessHours class to check whether a certain Date is a Business Day or Not. Here is my Business Hour in my Organization: Based on this, if I provide following date input, it ...
1
vote
0answers
490 views

Minutes between 2 Datetime fields excluding weekends

I pulled a formula from the Success boards to calculate the total minutes between 2 date/time fields, but exclude weekend hours. However, it is spitting out a value of "0" when the value should ...
0
votes
0answers
23 views

Using metadata api to set up BusinessHours for unit tests

I am looking at using the standard Salesforce BusinessHours configuration for a project. It is unfortunately not possible to insert this object using DML, which presents a challenge when writing ...
0
votes
0answers
201 views

How to respond to Einstein Bot after-hours message during business hours?

Background A Facebook Messenger Einstein Bot has an business-hours check as the first action, if it is out of business-hours it sends a message informing them that no one is available. Question How ...
0
votes
0answers
16 views

the field Case Time Duration(Formula) in Business Hours doesn't update every hour

Im trying to show the Case Time Duration in Business Hours. But it doesn't update every hour. I used this formula: ( 5 * FLOOR( ( DATEVALUE( NOW() ) - DATE( 1900, 1, 8) ) / 7) + MIN(5, MOD(...
0
votes
0answers
32 views

Salesforce formula to exclude holidays between two date time fields

I would like to create one formula field on Case object which calculates business hours between two dates. Weekends, as well as Holidays mentioned in Business hours, should be excluded in the formula. ...
0
votes
1answer
161 views

how do i give permission of updating business hours to a normal user other than system administrator?

Is there a way we can give a normal user with the previlage of updating business hours and holidays in salesforce? Any supporting URL would be really helpful. Thanks in advance.
0
votes
0answers
603 views

BusinessHours.isWithin() Not Working As Expecting

I am using the BusinessHours class and am just running some basic tests: BusinessHours bh = [SELECT Id, ThursdayStartTime FROM BusinessHours WHERE IsDefault = true]; if (BusinessHours.isWithin(bh.Id, ...
0
votes
1answer
72 views

How do I get time spent on a Task, excluding Holiday and Non-working hours?

How do I get time spend on a Task, excluding Holiday and Non-working hours? I'd like to get the total time spent on a Task, excluding holidays and non working hours. Is there a feasible way and how ...
0
votes
2answers
46 views

Counting Business days

I am looking to count business days from when a status is picked in a pick list on a case. I have the field awaiting customer input data adding today's date when the status is picked. This is working ...
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
votes
1answer
37 views

Incompatible element type Time for collection of Datetime for BusinessHours

I working to calculate the business hours from the Business day: List<BusinessHours> bhList = [SELECT FridayEndTime,FridayStartTime,Id,IsActive,IsDefault,LastModifiedById, ...