4 Replies Latest reply on May 1, 2016 7:22 PM by user19752

    Geting the active menu object to a variable

    andresen

      Hi

      I try to get the active menu tab name in a variable.  This so I can store it and after the script has done it's task I can get back to same layout I was in before the script started and to the same active menu tab.

       

      I have tried the,

       

           Set variable ( $TabName ; Get ( ActiveLayoutObjectName )

       

      Then recal the variable at the end,

       

           Go to Object ( $TabName )

       

      This don't work.

      Suggestions?

        • 1. Re: Geting the active menu object to a variable
          jormond

          I think you need to test each of the panels using the GetLayoutObjectAttribute ( "objectName" ; "isFrontTabPanel" ).

           

          It has been a little while, but I vaguely remember using a Case ( ) statement to test the object names to see which one is the front panel.

          • 2. Re: Geting the active menu object to a variable
            Extensitech
            • By "menu tab" do you just mean tab panel?
            • Do you have tab panels within other tab panels? If so, are you trying to get to the "main" tab panel or down to the individual tab panel that may be on another?
            • Are your tab panel object names consistent?
            • Does the active object always have a name? (You'll need one)
            • What are you clicking to trigger this script? If it's a button (as opposed to a field) you can't get the button name as the activelayoutobjectname. This means either passing the name as a hard-coded script parameter, or consider using a field with onObjectEnter (where you can get ( activelayoutobjectname ) ).

             

            You could also GetLayoutObjectAttribute ( "objectname" ; "enclosingObject" ). I, for example, have a recursive custom function that will start from a given object name and find the enclosing object until it comes to an object name that starts with "tab".

             

            Also consider that if you have the name of the current object, you could just return to that, and you'd end up getting to the tab, subtab, portal, etc. that it's on.

             

            HTH

            Chris Cain

            Extensitech

            • 3. Re: Geting the active menu object to a variable
              andresen

              Hi

              1. Yes.

              2. No, the tab panels are by it self in that layout.

              3. They have individual names. I have set the name in inspector, position, name.

              4. Yes

              5. I clicking a button.

               

              The purpose whit the button is to print out a order from the current layout. The order have it's own layout. After the printout I want it to go back were I started. And in the same tab.

              menu.png

              Is the menu: Kund, Kliché, ....

               

              my script so far is: in Swedish,

              Print out.png

              • 4. Re: Geting the active menu object to a variable
                user19752

                If you want to save some status (this case selected tab panel) in current layout, I prefer using "New Window" then do jobs and close it.

                1 of 1 people found this helpful