Here's a description of the issue:
I am having a layout with a couple of fields to be filled out by the person who is logged in.
Some fields have a "OnObjectExit" script trigger, starting a script A that verifies if the input is valid. I case of invalid input, it empties the field and prompts the user for valid input with information how this should look like.
There is also button "Next", triggering a script B that checks if all mandatory fields are filled and if this is the case switches to the next layout.
All works fine if the data field object is left by clicking somewhere else on the layout and the "Next" button is clicked only thereafter. But if invalid data (let's say a 2-digit year in a year field that requires a four-digit year) is entered and the "Next" button is hit without leaving the data field beforehand, things happen in a different way:
Script B is executed, only looking if mandatory fields are filled. This is also the case with the year field which holds a 2-digit year. So script B valides and moves on to the next layout.
Only after script B is executed, script A kicks in and checks the validity of the year data field in the now previous layout.
This sequence of user action circumvents the sequence
1. check validity (run script A)
2. check if all mandatory fields are filled, if no, stay on layout, if yes, move on. (run script B)
It is my understanding that script A should run first, because for activating the "Next" button, the year data field has to be left first.
Do I have a misconception of how FM is sequencing script triggers?
Thanks in advance for advise.