Approval Flow, Holidays

 4 Replies
 2 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Srini Rao
Veteran Member
Posts: 149
Veteran Member

    Hello - We are in process of implementing the requisition approvals. If approver does not perform the action in two working days it moves to next level. When I use the User Action Node, it includes the holidays like Sat and Sunday. If I create a requisition on Friday evening, it’s getting escalated to next level by Monday morning. How do I stop the timer during the weekend?


    Terry P
    Veteran Member
    Posts: 234
    Veteran Member
      You can use variables instead of values. Just do a check to see if Friday. If so, set the value to 4 instead of two.
      Woozy
      Veteran Member
      Posts: 709
      Veteran Member
        Yep, Terry P is exactly right. It's just a JavaScript task.

        You'll want to be sure you figure out what you'd want to happen for Thurs, Fri, Sat, and Sunday events, as the delay days would be different for each. Note that the clock starts ticking when the flow hits the UserAction node, so you need to calculate the delay just before that node, and recalculate for every UserAction node in your flow.

        For what it's worth, this could be worth creating a function in the pflow_user.js file that you can call directly, rather than having to duplicate your code before each Assign - particularly if you will use this in multiple flows.

        Holidays are more of a challenge, but I suppose you could store them in the CrossReference or something - someone would have to maintain these dates though.
        Kelly Meade
        J. R. Simplot Company
        Boise, ID
        Srini Rao
        Veteran Member
        Posts: 149
        Veteran Member
          Thanks Woozy and Terry P. I will create a Java script and try.


          Thanks Again
          Terry P
          Veteran Member
          Posts: 234
          Veteran Member

            I I recall, code something like this should work to set the variable vDays. Then just replace the value with the variable.

            if (today.getDay()=5) // This is Friday
            vDays = 3
            else
            vDays = 1