2 Replies Latest reply on Dec 7, 2014 1:34 PM by john.s

    Help with Tab Control script trigger



      Help with Tab Control script trigger



      I have a layout with tabs.  I'm trying to limit access to tab 6 using an OnTabSwithch script trigger.  That runs the following script.

      If [GetValue ( Get ( TriggerTargetTabPanel) ; 1 ) = "6"      
        If [Get ( AccountPrivilegeSetName ) = "Photographer"]
            Go to Object [Object Name: "Create Jobs"]
        End if
      End if

      So if a user with a Account privilege  of Photographer clicks on tab 6 I want to send them to a tab with an object name of "Create Jobs" which is the default tab for this layout.  I've checked to be sure the object "Create Jobs" name is defined.  This script does not do what I thought it would do.  What am I doing wrong?



        • 1. Re: Help with Tab Control script trigger

          If you look up "Setting up script triggers" in FileMaker help, you'll find that this trigger is tripped first, then FileMaker processes the event that tripped the script trigger. So your script takes the user to the object "Create Jobs", then processes the tab panel change and puts the user on the clicked tab panel.

          To keep the triggering event from being processed by FileMaker when it's a "before the event" trigger of this type, add this step after the Go To Object script step:

          Exit Script [False]

          The False parameter tells FileMaker to not process the triggering event and then a click on tab 6 won't still leave the user on tab 6 when the privilege set is named "photographer".

          • 2. Re: Help with Tab Control script trigger

            Thanks Phil...that worked perfectly.   I had tried to put in the Exit Script but did not know about the False result. That was the missing link.