1 Reply Latest reply on Dec 13, 2016 4:15 PM by AlasdairRobertson

    Disable Submission button based on Working hours (HOP)

    sgillard Apprentice

      I currently have a button that our users click to submit their Change Request for approval.  To allow our approvers a 24 hour window I put a disabled rule in place:

      $(if TypeOfChange == "Normal" && AddHours(-24,  TargetDate) < Now() then true  else false

       

      If someone sets their TargetDate to less than 24 hours it grays out the button.  This works great for weekdays. 

       

      However, if someone submits on Friday at 4PM  for a Monday 8 AM target date, you really only get 3 hours to get through the approval process (7am-6pm HOP)  but the system sees it's past Saturday at 4PM and does not gray the button.  This is causing confusion with our end users who don't stop to think about the fact they really are only allowing a few hours. And then have a fit when they miss getting their approvals in time.

       

      All of the HOP functions in Heat error out saying you can't use them for "disabled expressions" as I attempted to just say :

       

      $(if TypeOfChange == "Normal" && HOPCalcTargetDate("Weekly HOP", CurrentDateTime(), ((11 * 60) * 60)) < Now()

        then true else false

       

      I've also tried:

      $(TypeOfChange == "Normal" && AddWorkingSeconds⁽³⁾("Weekly HOP",  39600) < Now()

       

      it also says you can't use for disabled expressions...

      I was hoping someone would have another idea?

       

      Please and thanks!