Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4718 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

On another forum, a question was posed: http://forums.filema...cd768309#173535

OnObjectExit trigger - The only way I could make it work is to end the script with Halt Script. This struck me as strange because when a script ends, it halts anyway and we never need to end a script with Halt Script.

Debugger shows it does go to the specified field but then immediately jumps to the next in tab order. I did not expect this behavior (between tabs and script trigger) and I am trying to understand the underlying logic:

  • User tabs which exits field
  • trigger fires and places cursor in field outside of tab order
  • tab attempts to finish after script ends by moving to next field in tab order

If FM is holding this 'I must finish by moving to next field in tab order after this script ends', might this not bite us in other script triggers, particularly (but not limited to) triggers which move through fields or that depend upon landing in a specific field?

Input greatly appreciated. To make it easier, here is sample file.

Trigger.zip

Posted

The OnObjectExit trigger runs a script when an attempt is made to exit the active object. If the script returns true, the original event proceeds normally - after the script has run. The 'original event' in this case is tabbing out of the field into the next field in tab order.

Since the script has already moved the cursor to another field, and the OP does not want the 'original event' to proceed, they should end the script with Exit Script [ False ]. It seems like halting the script achieves the same thing - but it also has wider repercussions than that, so I don't think it's a good replacement.

Note that not all script triggers run before the 'original event' is executed.

Posted

Hello Michael!

Oh of course! The original event is the tab! Now that you explain (as only you can), it makes perfect sense. I have notified the OP of your better solution. Thank you. :laugh2:

This topic is 4718 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.