Running validation feedback upon page load for an object
I am attempting to have validation feedback messages display on as soon as the page loads, but I have so far been unable to get this working. The business case is that a number of records of entity A enter the system through an API. Records with data problems are flagged for a special review queue. Users log in and open up one of the records in the queue to fix the data manually. I'd love to have the validation feedback messages show in line when that page opens. If I make the 'edit' button a microflow that shows the page and then calls the sub flow that validates entity A and displays validation feedback messages, I get a popup with the validation messages instead of in-line highlighting of the error fields. This is the same popup I see when we the UI tries to display validation feedback on fields not present on the current page. I have also tried usign a helper entity that is associated with the incoming record in a microflow and then is used to retrieve that record as part of a data source microflow for an object on the page. The result is the same as above. I have a 'submit' button on the page that users can click. It runs the validation flow and puts feedback messages on the data entry widgets just fine. I suspect this has something to do with how Mendix loads up the widgets on the page after running microflows, so maybe I need some JS to trigger the validation flow behind the scenes after page load. Is that a reasonable approach? Is there some way to run those validations upon page load so I get the nice in-line feedback messages instead of the popup?
Ok I have developed a bootleg solution, but one that certinally works.
What I have done is used the Microflow Timer widget to call a microflow after a 10 millisecond delay. This microflow calls the sub_flow that runs the validations and displays the feedback messages.
Now I can simply open the page as usual and then have validation feedback messages show up immediately on the page.