Hi Mathew,
if you are not using above dynamic class condition your output will be like this:
if you are using dynamic class condition then output will be
Hi Matthew,
Mendix runs the validations, “basically” in this sequence:
1 – UI Pages/Widget validations
2 – Entity Validations Rules
3 – Microflows/Nanoflow
Resume: Mendix best practices suggest to keep all validations within a Microflow, to avoid duplicated validations and validations showing up partially…
Check this https://medium.com/mendix/expert-validations-in-mendix-10e1bdfc7bc0
Alternatively check this module – https://marketplace.mendix.com/link/component/110282
Its can add some extras features to your MF validations as well show up the Missing/Required fields in a popup window.
Best regards
Hey Matthew,
I’ve not yet seen the combo of marking a field as required + call a microflow to show a message since the required mark won’t let you go through with a Microflow. Although this could probably be possible by adding an Event on change by Microflow to that field but I found that it’s not that nice for the user experience
What i’ve done is put validations on fields which require just any input and for validation which need extra business logic I do the validation in a microflow on Save
Example:
Customer name is validated through validation on the field itself,
Customer Email can not be the logged in users email so for this i do the validation on Save and use a decision step for the validation. If true → Show info message, If false → go through with the Save
Hope this gives you some inspiration
Hi Mathew,
You can check this idea but it will be good if we have 1 or 2 fields. if we have more field then we have to go for different approach.
Add one boolean attribute to the domain model with default value true. On click of save , if the field value is empty update this boolean variable to false.
In your field widget add dynamic class like this in appearance tab.
Define the below CSS definition in input.scss file
.mandatory {
border: 1px solid red !important;
padding:0px !important;
}
Alternatively you can do this with just creating an overlay and change the styling. Create an overlay, add some title and text and container for the validation-messages.