https://unofficialsf.com/wp-content/uploads/2022/09/largeUCSF-300x133.png 0 0 Alex Edelstein https://unofficialsf.com/wp-content/uploads/2022/09/largeUCSF-300x133.png Alex Edelstein2022-10-23 12:56:532022-10-23 12:56:59From Renato Oliveira: New Business Hours Actions
Renato has built a package that exposes the main Business Hours functions that are normally only available to Apex developers:
Here are the actions:
- BusinessHoursAddAction (businessHoursId, startDate, intervalMilliseconds)
Adds an interval of time from a start Datetime traversing business hours only. Returns the result Datetime in the local time zone.
- BusinessHoursAddGmtAction (businessHoursId, startDate, intervalMilliseconds)
Adds an interval of milliseconds from a start Datetime traversing business hours only. Returns the result Datetime in GMT.
- BusinessHoursDiffAction (businessHoursId, startDate, endDate)
Returns the difference in milliseconds between a start and end Datetime based on a specific set of business hours.
- BusinessHoursIsWithinAction (businessHoursId, targetDate)
Returns true if the specified target date occurs within business hours. Holidays are included in the calculation.
- BusinessHoursNextStartDateAction (businessHoursId, targetDate)
Starting from the specified target date, returns the next date when business hours are open. If the specified target date falls within business hours, this target date is returned.