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

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

Recommended Posts

Posted

Ok this is driving me crazy! I have tried every single thing I can imagine for a number of days and I have no idea what is going on.

Whever I use the "go to field" function in a script it does NOT work. I even tested it with the simplest of scripts...having it be the only step...and the result is always the same. It does not put the user in the specified field...instead it puts them in the field AFTER the specified field.

Does anyone have any ideas at all about why this would be happening? Is it possible there is a bug? Something I overlooked? Something really simple? Has anyone ever had this problem? I've searched on the web for it but haven't found anything else related to this issue.

Help would be much appreciated! I'm doing much more complex things just fine it seems so weird that this little thing would be tripping me up.

Thanks in advance,

Annie

Posted

Do you happen to have two copies of the same field on the layout? Are you using the correct Table Occurrence when you specify the target field?

Posted

Hi John,

I made something very simple to test it out. A layout with source table "Contacts" with only three fields on it from the same occurence "Contacts."

All fields can be entered in browse mode (they are name_first and name_last and source). There is no tab order set up. My script has only one step "go to field[Contacts::name_last]" and it is triggered OnObjectExit from the name_first field. When it runs, instead of landing the user in the target field, it puts you in the one after it, in this case the source field.

I added a pause/resume script step after the "go to field" and it appears that the cursor does actually go to that field, but once the script finishes (I hit continue) I end up in the source field.

Any ideas for this strange behavior??

Annie

Posted

Here is a sample file I made to demonstrate the problem. As you can see the script works fine when I add the step "ExitScript[False]" (as suggested in another forum), but it does not work normally as it should. Any ideas about why this would be happening??

GoToField.zip

Posted

This file does NOT do what you said in your original post:

It does not put the user in the specified field...instead it puts them in the field AFTER the specified field.

As for explanation:

A script triggered OnObjectExit runs when an attempt is made to exit the object. When the script does not return a false result, the attempt is carried out to completion - after running the script.

IOW, if you exit field one by clicking into field three, the script runs and puts you in field two - and immediately after that you are taken to field three, as you wished.

Posted

Thanks for the explanation! This totally solves the problem!

I also recieved this from PhilModJunk on the FileMaker support forum...

"If you look up script triggers in Filemaker Help, it'll tell you which triggers fire before the triggering event and which fire after the triggering event. This trigger fires before the event. After your script goes to the specified field, the triggering event then completes and this is what takes it to the next field in the tab order. As stated in the help, for "before the event" triggers, exit [false] should be used to keep the triggering event from actually taking place."

This topic is 5409 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.