Not sure if I understood correctly. Have you tried using the layout script trigger? i.e. both “OnLayoutExit and OnrecordCommit”
Yes it seems the best way is going to be validate mandatory fields OnRecordCommit. This would be required in case mouse click is used and a field in the tab order is missed out.
I thought it would be nice to have a dialog displayed when a mandatory field is exited and no content has been entered.
if you use even the OnLayoutExit (could be the same script as onRecordCommit) you can check manadatory field even if the user just enter in the layout and do nothing (no click or tab in any field)
Some good advice there, but would not work with my system.
I have a commit button which runs a load more scripts before the layout is switched therefore not feasible in my case. I would be best to do the mandatory check in the script attached to the commit button (there is no way the layout can be exited without clicking commit or cancel)
It is looking like I will have to use three triggers, OnObjectValidate, OnObjectExit and OnRecordCommit.
OnObjectValidate - All validation apart from mandatory field validation
OnObjectExit - Mandatory field validation when tab is used.
OnRecordCommit - Any mandatory fields that have been skipped using mouse.