This function will be deprecated in a future release, so use it with caution.
However, it is still supported for existing expressions, so it has not been removed from the application. Editing an expression using this function can cause an error message to appear.
Calculates the end date and time based on a start date, hours of operation (HOP) schedule, and an interval.
This function takes into account the calendar defined by the reference hours of operation. The hours of operation is based on the tenant rather than the server configuration.
HOPCalcTargetDate(hopIdOrName, localStartDateTime, durationInSeconds)
For a description of the business object categories, see Notes on "Enabled For".
|Business Object Category||Yes/No|
|Business Rules: Before-Save Rules||Yes|
|Business Rules: Calculation Rules (After Save, with or without Also Recalculate on Load)||Yes|
|Business Rules: Calculation Rules (Before Save or Always, without Also Recalculate On Load)||Yes|
|Business Rules: Calculation Rules (Before Save or Always, with Recalculate On Load)||Yes|
|Business Rules: Editing Rules||Yes1|
|Business Rules: Initialization Rules||Yes|
|Business Rules: Read Only Rules||No|
|Business Rules: Required Rules||Yes1|
|Business Rules: Validation Rules||Yes|
|Quick Actions (except UI Quick Actions)||Yes|
|UI Quick Actions||No|
|Search/Dashboard without field references||Yes|
|Search/Dashboard with field references||No|
|1. Except when this field appears on a form or is triggered by such a field.|
The hours of operation schedule name as defined (for example, 24x7 or 9 to 5). See Setting Up Hours of Operation.
The starting date and time.
(Optional) The interval in seconds. If this parameter is not used, it defaults to 0, which means that it returns the very first second of the next work period (operating interval).
You can use basic math operations to calculate the seconds or you can use an expression.
$(HOPCalcTargetDate("Weekly HOP", CurrentDateTime(), ((12 * 60) * 60)))
This example calculates the date and time for 12 operating hours from the current date and time using the hours of operation schedule called Weekly HOP.