2 Replies Latest reply on Feb 28, 2013 4:53 PM by R12GS

    Script trigger upon leaving a TAB (FM11)

    R12GS

      Title

      Script trigger upon leaving a TAB (FM11)

      Post

           I want to run a script to verify that the user did not leave some fields empty in TAB2.  It's ideal to do this upon selection of TAB3.  At which point I want to run the script, and if TAB2 needs more info then it navigates back to TAB2 instead of advancing to TAB3.

           In layout mode, I select TAB2.  Format>Set Script Trigger>   and select "onobjectexit", choose the scriptname etc.  But I want it to address only TAB2.  But setting this trigger SETS 'onobjectexit' to ALL TABS.  

           It runs the script upon exit from TAB1, before the user has even seen the TAB2 fields (which are of course empty)

           How do I get the script to trigger ONLY upon exit of TAB2.  Upon entry to TAB3 would be OK too.

        • 1. Re: Script trigger upon leaving a TAB (FM11)
          philmodjunk

               This is one of the areas where FileMaker 12 has improved on the options available in FileMaker 11.

               In Filemaker 11, you can use the OnObjectModify trigger to detect that a different tab panel was clicked. But you then need to use the Name box in the inspector's position tab to give each tab panel an object name.

               Then a script with several If, else if, clauses can use GetLayoutObjectAttribute to determine which object is currrently the front tab panel.

          • 2. Re: Script trigger upon leaving a TAB (FM11)
            R12GS

                 Hi Phil, Thx for the help.   I have named my 3 TABs as "select", "customer", "order"  in the Inspector) .  I want the script to run ONLY (uponexit) if the TAB exiting from is named "customer.

                 If [GetLayoutObjectAttribute(objectName;"customer") = "customer"] 

                 I took a stab at it but the script editor won't accept this calculation, and I can't understand how to configureit.  I ONLY need to run the script if the user is on the "customer" tab.

                 Can you help with my "Get" calculation?

                  

                  .......or it is going to be a lot more complicated than this?