2 Replies Latest reply on Dec 26, 2012 9:07 AM by philmodjunk

    Trouble with field navigation

    rsagall_1

      Title

      Trouble with field navigation

      Post

           I have a simple layout with four fields.  I set up the tab order that tabs from 1 to 2, 2 to 3, and 3 to 4. Sometimes the data is field  1 triggers a script that auto fills fields 2 and 3 and sometimes the user has to fill fields 2 and 3. If the auto fill occurs I the user then next manually enters data in to field 4.

           The problem is that after the script run the cursor is always on field 2.

            

           I tried the "Go to field" with field 4 as the designated field, but it jumped back to field 2.

           Any suggestions?

            

           Rich

            

        • 1. Re: Trouble with field navigation
          Jade

               Hi Rich,

               Try putting the following scriptstep at the end of your triggered script:

                Exit Script[Result: False]

               Depending on the trigger timing, focus may return to your first field when the script terminates.   If that is the case,  it will tab to the second field if the script returns True.

          • 2. Re: Trouble with field navigation
            philmodjunk

                 I Ditto Jade's suggestion. If you look up script triggers in FileMaker Help, you'll find that there's a little table showing which triggers trip before the triggering event is processed and which are tripped after the triggering event. With OnObjectExit, your go to field step is putting the focus in the specified field, then FileMaker processes the triggering event (tab is pressed, a place on the layout is clicked...) and puts the focus where that event specifies.

                 Triggers such as OnObjectExit are "before" triggers and you can use Exit Script [False] as a way to cancel out the event that tripped the trigger in the first place--keeping the cursor where you want it to be.