Image Validation

0
Hi Mendix community, I’m encountering a problem when I want to validate an entity that inherits from System.Image. I setup my domain model like this: I created an entity that inherits from System.Image and added an extra attribute (to hold some text) to this entity. When the user clicks the save button, I want to check, using a microflow, whether the textfield contains a value and the object contains an image. When creating and testing this validation I encountered the following problem. The validation on the text-input field and the image takes place, although on the image it’s represented by a popup and not a message underneath the uploadbox. When I upload an image and click the save button once again, without entering anything in the text-input field, the image gets saved in the DB, although there was a validation error for the text-input field. How can I prevent the image from being saved to the DB when there still are validation errors? Hope I described my case clear enough. In case of doubt, just ask!    With kind regards, Tom
asked
1 answers
1

Hi,

Here’s a quick update. I managed to get it to work by adding validation rules to the datamodel. The combination of the validation provided by the datamodel and the microflow results in the desired behavior.

Tom

answered