Microflow commit result

1
How can I see whether a commit with events in a microflow change action has succeeded or not (i.e. validations returned true or false)? I very often return false in Validation Microflows that also send Validation Feedback in those cases. I thought thats the way to do complex validations in Mendix. In this case we decided to make a custom save button (to distinguish the GUI save from other microflow change with commits). There is nice validation feedback, however the microflow closes the form before we can read it..
asked
2 answers
0

Normally it is commited, otherwise you get an error. You can add a custom commit handler. (right mouse click on action: set Error Handler).

answered
0

My best practice: You should NEVER return false from a before commit event, because you won't know that the object is not saved*. Either return true or throw an exception (using community commons for example)

* Unless the object still has the ischanged/ isnew flags, you can use community commons to check them.

answered