3 Replies Latest reply on Jun 13, 2011 10:16 PM by $Nith$

    Deny with required comments

    Han Dao Level 1

      Hello Everyone,


      I am working on the form with the process to route to the Manager to approve/deny the request. If the Manager is denied the request, I'd like to have them to put some comments (reason to deny) in the Comment field to require them to fill only for the Denial option to let the user know why it is denied. Can any one please advise how to have it done in the form/process.




        • 1. Re: Deny with required comments
          $Nith$ Level 4

          The selected action will be populated on a process field named AWS_ACTION.


          You can perform a validation on preSubmit event of the form which ensures the comments field was filled in case Deny action is selected.


          Cancel the submit operation if the valdiation fails.


          Here is the code:


          form::preSubmit (javascript)


          if( AWS_ACTION.rawValue == "Deny" && (yourCommentsField.rawValue == null || yourCommentsField.rawValue == "" ) )


               app.alert("Please mention the reason for rejection in the comments field");

               yourCommentsField.mandatory = "error";     // make the comments field mandatory

               xfa.event.cancelAction = true;                    // This line will prevent submitting the form



          Hope that helps


          1 person found this helpful
          • 2. Re: Deny with required comments
            Han Dao Level 1

            Hi Nith,


            Thanks for the helpful tip. It works just fine. I now run into a different issue when it tries to complete. I keep getting this stalled error in the log file at the completion of the process even though it works just fine. I try to use other service but still get the same issue like this one: Foundation>DecisionPoint>Execute.


            [6/13/11 8:37:24:906 CDT] 00000043 AWS           E com.adobe.workflow.engine.ProcessEngineBMTBean stallAction stalling action-instance: 42761 with message: javax.ejb.TransactionRolledbackLocalException:  ; nested exception is: java.lang.NullPointerException


            Can you please advise,


            Thanks, Han

            • 3. Re: Deny with required comments
              $Nith$ Level 4

              Not sure what causing the NullPointerException.


              Just make sure the conditions specified in the decisionpoint activity are valid. If you are using assignments, double check the xpath expressions where SOMs are valid.


              Couldn't assist you much on this error due to insufficient exception details.