amfca Posted July 12, 2012 Share Posted July 12, 2012 I have a field that has the onObjectExit script trigger set to run a validation script. Works fine when tabbing out of field or when clicking into another field on layout. Problem I am having is when still in the field and user clicks another button object on layout that has script attached, it runs the button script first and then the onObjectExit script. By clicking on another button, why does the current fields onObjectExit script not fire first when it looses focus? Any help to solve this is appreciated! Using FMPA 11.0v4 Alan Link to comment Share on other sites More sharing options...
Techphan Posted July 12, 2012 Share Posted July 12, 2012 Problem I am having is when still in the field and user clicks another button object on layout (Action #1) that has script attached, it runs the button script first and then the OnObjectExit script (Action #2). FileMaker is just doing things in the order of the requests. The user-clicked button is #1, then after that script ends (pauses) then the OnObjectExit script triggered is fired. What are you trying to do? I almost always use OnObjectModify and this may work for you. Link to comment Share on other sites More sharing options...
amfca Posted July 12, 2012 Author Share Posted July 12, 2012 FileMaker is just doing things in the order of the requests. The user-clicked button is #1, then after that script ends (pauses) then the OnObjectExit script triggered is fired. What are you trying to do? I almost always use OnObjectModify and this may work for you. Thanks for your comments! What I don't understand is the order then. If I am in field "A" and click out of field "A" to a button, why is field "A" onexit script seen as action #2? Does it not lose focus when clicked out of? Should it not fire when a user clicks a different object? Description of script trigger step says OnObjectExit Triggers a script to run before an active object is exited as a result of the following: [TABLE] [TR] [TD] • [/TD] [TD] a user tabs away from an object [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD] • [/TD] [TD] a user clicks a different object [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD] • [/TD] [TD] a script step attempts to make a different object be the active object [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD] • [/TD] [TD] a user requests a dialog box that would normally cause the field to be exited [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD] • [/TD] [TD] a user attempts to move between rows in a portal object [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD] • [/TD] [TD] a user attempts to move between repetitions in a repeating field [/TD] [/TR] [/TABLE] My situation is that I want to check field "A" to see if it is null under certain conditions (another field has a value or not) and throw up a message dialog box. Field "A" may have been entered and not modified, so not using the modify trigger. Thanks for your help. Link to comment Share on other sites More sharing options...
Techphan Posted July 12, 2012 Share Posted July 12, 2012 What I don't understand is the order then. If I am in field "A" and click out of field "A" to a button, why is field "A" onexit script seen as action #2? Does it not lose focus when clicked out of? Should it not fire when a user clicks a different object? Because you can click a button with the cursor still inside the field and the click does not cause the cursor to exit the field - unless you explicitly code this. With a little bit of clever coding you most likely will be able to "trap" for this occurrence and actually pace the button-pushed script in the queue BEHIND the script triggered by OnObjectExit . Link to comment Share on other sites More sharing options...
amfca Posted July 13, 2012 Author Share Posted July 13, 2012 Because you can click a button with the cursor still inside the field and the click does not cause the cursor to exit the field - unless you explicitly code this. With a little bit of clever coding you most likely will be able to "trap" for this occurrence and actually pace the button-pushed script in the queue BEHIND the script triggered by OnObjectExit . Not sure how to trap for this, but I will give it some thought. Thanks for your reply and thoughts.... Link to comment Share on other sites More sharing options...
Recommended Posts