2 Replies Latest reply on Feb 16, 2012 4:14 PM by Jick Flaviano

    Approval Rule is not working when User with no Supervisor creates Requisition

    Jick Flaviano Expert

      Approval Rule is not working when User with no Supervisor creates Requisition. I've tried to check  the Javascript, syntax is correct but still, when the User creates a Requisition a different Role (Purchasing Agent) wass added on the Approval Flow.

       

      Please see below for the Java Script for User with no supervisor, notice that the CFO role must be added when a User creates a requisition which has no supervisor. Where do I start to investigating this issue? Please help

       

      Condition:

      function nomanager_condition (r)
      {
          return User2Supervisor(r.getRequester()) == null;
      }

      nomanager_condition;

       

       

      Action:

      var Role_CFO = Role.getRole("CFO");

      function nomanager_action (r)
      {
          return ApprovalRequest.create(r,
                                     Role_CFO,
                                     true,
                                     "ruleReasons", "NoManagerThenCFO");
      }

      nomanager_action;