How does the Show Validation Message action work?

2
I have raised a question on validating a reference selector (see thread) & been advised to try using a 'Show validation message' action, however this is not working as I expected - specifically there doesn't appear to be any way to capture the result of the validation (pass/fail) in order to control subsequent processing of the microflow. I need to be able to validate the data entered on a form (in this case whether a reference selector is filled or is empty) within a microflow triggered by an action trigger and either return to the form without committing (if the validation fails) or to commit & close the form (if the validation passes). Currently the validation message is being displayed & the object committed regardless of whether the validation passes or fails.
asked
2 answers
1

Andrew,

I use this feature the exact same way as you describe. What I do is create a variable called 'break commit' at the begin of the microflow of type 'boolean'.

I then do the validations that I would like to perform by checking if the required fields are filled by (by using the following check: != empty and != ' '). If this check returns false, I set the 'break commit' variable to true and specify the errormessage.

I do this for all the required fields and at the end of the microflow I check whether the commit even should broken or not. If so, I break the commit event (and do nothing else), if not, I commit the object and close the form.

I hope this helps you out, if not entirely clear please let me know

answered
0

Hi Andrew,

The 'Show validation message' only sends a message to the client which is put below an input in red. You have to do the validation yourself and you have to prevent the platform from committing your object by returning false in you before commit event.

See my answer on your previous question for more detailed information.

answered