Method to calculate if the CurrentDateTime() falls within a designated HOP without using deprecated functions

Version 1

    Details

    Method to calculate if the CurrentDateTime() falls within a designated HOP without using deprecated functions
    This method should be good well into the future.


    Resolution

    Method for determining if you are currently within a HOP (using Incident in the example)

    Add the following to the Incident Object
       a. Create a new field "InThisHOP" (text32)
       b. Initialization rule for this field:
          $(if DiffWorkingSeconds("Working Hours",
             CurrentDateTime(),
             addseconds(1,  CurrentDateTime())) >
             0
          then "true"
          else "false")
       c. Create a new field "IsThisHOP" (Boolean)
       d. Always calculated rule to set this value:
          $(if InThisHOP == "true" then true else false)

    This solution use no deprecated functions and should work well into the future.