September 10, 200916 yr Hello, I've setup some field validation using script triggers and it works well. My script has an Exit Script Result: 0 step to prevent the user from leaving the field if the data fails validation. My solution, like many, also makes use of scripted navigation and that's where the problems start. If the user modifies one of those fields and then hits a navigation button the navigation script is triggered first. Then, upon reaching a script step that takes the focus away from the field, the field validation script gets triggered, the validation fails with an Exit Script Result: 0 and the focus remains on the field, but the navigation script keeps going... so I get a bunch of error messages since the script assumes you have left the field/layout, which in fact did not happen. I can't have both an Halt Script step (to halt all running navigation scripts) AND an Exit Script Result: 0 (to prevent the fiels from being exited)... So how do I run a scrip trigger field validation script that can halt running scripts AND return a False for the field navigation ? It seems I shouldn't be the only one having this problem but I couldn't find anything about it anywhere, it must be really obvious that no one has had to post about it... Thanks for pointing me in the right direction.
September 21, 200916 yr Author Hello, Thanks for replying. The "Commit Record" step would trigger the validation script on the field but the problem remains: if the validation fails then the record cannot be committed (can't navigate to another layout) yet the nav script keeps going assuming the layout has been changed... Thanks for the help though, short of modifying all my nav scripts I'm still at a loss as to how to solve this one... Cheers
September 22, 200916 yr What is you put a If (GetScriptResult) = 0, Halt, at the top of the nav script? Since your validation script has an Exit Script (Result; 0)?
September 22, 200916 yr Author I would have to add that at the top of ALL the scripts that commit the records, there are a lot. So far it's the only solution I see though...
September 23, 200916 yr I've accomplished this in the past by creating a "before nav" script that I call at the top of all my nav scripts. In the before nav script, I deal with all the dirty work logic, and call a halt if necessary. It's an ugly solution, but AFAIK there isn't a better option in FileMaker.
Create an account or sign in to comment