3 Replies Latest reply on Jun 9, 2014 2:10 PM by philmodjunk

    Starting Script Based On Tab...

    productionQC

      Title

      Starting Script Based On Tab...

      Post

           Hello-

           I am using FMPA 13.  I have three tabs setup, each with a chart on it.  I need to change the sort order based on the tab/chart the user is looking at.  I can not seem to figure out how to make this happen.  All I need is if the user selects the second tab to run a script and I can't seem to make this happen.  I know there are some new script triggers, like OnPanelSwitch (previously OnTabSwitch) but I think they need to be combined with Get ( TriggerTargetPanel ) but I have not been able to incorporate the two, or even if I need to????

           Thanks

            

        • 1. Re: Starting Script Based On Tab...
          philmodjunk

               You are on the right track. That is the correct script trigger and they renamed it as sliding a slider to a new panel also trips this same trigger.

               The relevant functions to use in a script performed by this trigger are:

               Get(TriggerCurrentPanel)--returns the number and object name of the panel FROM which the user is switching

               Get(TriggerTargetPanel)--returns the number and object name of the panel TO which the user is switching

               Both are documented in FileMaker Help. You can either use the Inspector's name box to assign an object name to each panel or you can simply check the number value returned. (The functions return a list of panel number and object name, so you can use getValue to extract either the number or the name form the text returned by these functions.)     

          • 2. Re: Starting Script Based On Tab...
            productionQC

                 Hi Phil-

                 Thanks for the response.  I did read exactly what you have stated, but I guess the issue is how do incorporate the get Value In the script itself.  I have been trying -  If (Get(TriggerTargetPanel) = ??? but I need to get the value.

                  

            Thanks

                  

            • 3. Re: Starting Script Based On Tab...
              philmodjunk

                   Referring to the help article on this function:

                   

                        When the tab or slide panel to be switched to is number 2, named “Products,” Get(TriggerTargetPanel) returns:

                   

                        2
                        Products

                   So

                   GetValue ( Get(TriggerTargetPanel) ; 1 ) would return the value 2--the number of the new panel.
                   GetValue ( Get(TriggerTargetPanel) ; 2 ) would return the value "Products"--the object name of the new panel.