3 Replies Latest reply on Jan 14, 2015 4:40 PM by philmodjunk

    Tab Loop?

    ChrisJohnston

      Title

      Tab Loop?

      Post

      Does anybody have any techniques for running a script when entering a Tab. I have tried things like this:

      
      If [$$var1 = 1]
        Exit Script [Result: False]
      End If
      Set Variable [$$var1; Value 1]
      
      *** My Script ***
      
      Set Variable [$$var1; Value ""]
      Exit Script [Result: True]
      

      But the problem is that now I can’t exit the tab. I have given them unique Object names, and thought I could use this to my advantage? When I assign the OnObjectModify Script Trigger should it only work with current Tab? When I do this, I am stuck running the script in current Tab when I try to navigate to other Tab. Thanks

        • 1. Re: Tab Loop?
          philmodjunk

          What version of FileMaker are you using?

          If FileMaker 12 or 13, there is a script trigger specific to changing panels that you would normally use for this instead of OnObjectModify.

          A key difference between different triggers is whether the trigger is tripped before or after the triggering event is processed. OnObjectModify processes the event (changing tab panels) before tripping the trigger. Thus, Exit Script [False] has no effect on whether or not the tab panel change takes place.

          But OnPanelSwitch (name is different in version 12) is tripped before the triggering event is processed and thus Exit Script [False] can cancel out the panel change when this trigger is used.

          • 2. Re: Tab Loop?
            ChrisJohnston

            FileMaker 13

            • 3. Re: Tab Loop?
              philmodjunk

              Then I recommend that you use OnPanelSwitch instead of OnObjectModify for the reasons listed above.