How Before Commit Event Handler works?

I have a Before Commit Event Handler in an Entity and I want it to check if a condition is met in order to commit the object and if not to show a customized Message and cancel the Commit. I thought that this is the most common usage of BCO event, but it doesn’t work as planned. If the BCO Microflow returns false, I get the standard Error if I check the “raise error if false” in the Event Handler properties and I get a “Response JSON is empty Error” if I don’t. How can I catch this error and handle it properly, while canceling the Commit?
2 answers

What do you mean by ‘side effect from another process’?

Usually you would not put validation for user feedback on events. Can you explain, why it’s not option to do that in a microflow?

On the other hand – are you really using Mendix 7.13? The response you get could also be some Bug.

regards, Fabian


If you want to validate the entity and show a message to the user it is best to do this with a microflow button, for example a custom save button. You can check the entity there and show for example a validation feedback for the user to see what is wrong.