Require comment on task not working

  • 19 October 2018
  • 3 replies
  • 91 views

Badge +7

I have a flexitask to which I have added a More Information outcome in addition to the standard Approve and Reject outcomes.  I have set the Reject and More information outcomes to require comment, however I am able to complete the task without adding a comment. 

I am using a custom task form, as well, so I decided to put a validation on the Comment to force the requirement with a form rule.  But this also is allowing the task to be completed without entering a comment.  Any suggestions?  Screenshots attached.


3 replies

Badge +11

Try to add 1 rule on the comment field: and(decision!="Approved",isnullorempty(Comment))

hope that helps.

Userlevel 4
Badge +12

Is this on premises? Then the "required" option for comments only works for the default SharePoint task form. So you will have to validate this by using a rule.

In an on premises environment the outcome is not validated by text but by an ID that will be generated by SharePoint.

Do the following:

  1. temporarily add a formula control to your form and put the named control of your outcome in it
  2. publish the form and the workflow (don't use the preview)
  3. run the workflow and push it towards your task
  4. now in the task form when selecting the outcomes, your formula should represent the value of the selected outcome like "0", "1", "4" and so on, remember the value of your required comment outcome "more information" (lets pretend it's 4)
  5. now edit your task form again
  6. remove the formula
  7. edit your comment validation rule to and(decision==4,isnullorempty(Comment))

Now your validation should work fine. Stuff like this only runs in published mode and will somehow not work in preview mode.

Hope this helps.

Best regards

Enrico

Badge

Thank you Enrico, that worked!

Reply