Mandatory Comments Validation Rule

  • 24 July 2015
  • 6 replies
  • 21 views

Badge +2

Hello there,

I have several tasks on my workflow and made the Comment field mandatory for negative outcome. Before using Nintex form on the task, the it was working fine (using SharePoint stock task interface) but after applying Nintex form to the task (from the task ribbon), the mandatory comment validation rule stopped working. Now users are able to reject the task without providing Comment (although it is set as Required on the task). I also inserted the validation rules as suggested by Nintex Community. It did not work either. SharePoint stock task interface is working fine though.

Further investigation showed that the value of the Decision field on the task form is -1 (negative one) for both Approved and Rejected outcomes. Surprisingly, the workflow can distinguish between two different outcomes (although their value is the same).

It would be great if you can share your insight with me on this. Thank you!


6 replies

Userlevel 5
Badge +12

Hi there,

 

When you did your investigation to determine both values were "-1" were you by chance looking at it through the preview form window?   In order to use the Inspect Element option, you have to run the workflow live and then inspect the live task form.  The preview form will always return a -1 for both values.

 

Thanks

Badge +11

As Mike M said, thats correct. It shows -1 in preview form.

Here is the reference to create validation on the Comments box.

Using validation rules to ensure a comments box is not left empty

Badge +2

Hi Mike,

Thank you very much for your repose. I ran the work flow, the value of  Accepted and Rejected is 5 and 6 respectively. I tried the validation rule this time it worked. I really appreciate your help. BTW I was wondering why we need to write a validation rule while we already made it Required on the task level?

Badge +2

Hi Kapil,

Thank you but as I mentioned in my reply to Mike, It worked. I appreciate your response.

Badge +2

Hi Mike,

One more thing, I just realized that the value of Approved and Rejected outcomes change based on the environment. For example in our staging environment it's 5 and 6 while in production environment it's 4 and 5. Not sure if they will remain the same all the time or they may change base don the server.

Userlevel 5
Badge +12

Glad to have helped Houman, and yes you are correct, the values can be different among environments.  See this post here to see how you can look at the DB to see what the values are as well: Task Form Outcome Conditional Formatting/Validation

Reply