6 Replies Latest reply on Sep 16, 2014 11:01 AM by NaturSalus

    Back Button Setup

    NaturSalus

      Title

      Back Button Setup

      Post

      Hello,

      I have a simple Back button set up that moves back to the active previous layout by fails directing to the active previous tab control.

      In layout A I have a portal that displays related records created in layout B through scripting.

      Using the GTRR script step the user can move from a record created on layout A to the related records in layout B.

      record on layout A ---GTRR---> record on layout B

      I would like to go from a record on layout B  back to the active tab of a record on layout A that contains the portal mentioned before. This is not working using GTRR due to the way I set up relationships and named the TOs.

      So, an easy way to go back from record on layout B to record on layout A would be to create a simple Back button.

      record on layout B ---BACK button--> record on layout A

      All I have to do is

             
      • when on layout A, capture the name of layout A and the name of the name of the active Tab object.
      •      
      • when on layout B, put a button that triggers the Go back to layout and tab script.

       

      The Previous Layout script captures the layout name:

      Set variable [$$PreviousLayout; Value: Get(Layout Name)]

       

      The Previous Active Tab script captures the name of the Tab object:

      Set variable [$$PreviousActiveTab; Value: Get(TriggerCurrentTabPanel)]

       

      The Go back to layout and tab script takes back from record on layout B to previous record on layout A:

      Go to Layout [$$PreviousLayout]

      Go to Object [Object Name: $$PreviousActiveTab]

      SETTINGS

      For layout  A OnLayoutExit triggers the Previous Layout script.

      For the Tab Control that has 9 tabs: OnTabSwitch triggers the Previous Active Tab script

       

      As mentioned before, when I click on the Back button I am returned to the previous record on layout A but lands on Tab 1 instead of Tab3.

      Where is my mistake?

       

      Thanks

       

       

       

       

       

       

       

       

       

        • 1. Re: Back Button Setup
          philmodjunk

          Whether you use GTRR or Go to Layout to return to the previous layout, the problem lies here:

          Set variable [$$PreviousActiveTab; Value: Get(TriggerCurrentTabPanel)]

          This get function returns a list of two values, only one of the two values is the object name of the panel. (You did use the Inspector to given the panel an object name didn't you?)

          Modify this script step's expression to be: GetValue ( Get(TriggerCurrentTabPanel) ; 2 )

          • 2. Re: Back Button Setup
            NaturSalus

            Hello Phil,

            Thanks for looking into my question.

            You did use the Inspector to given the panel an object name didn't you?)

            Yes,

            Tab 1 name is: cIdentification

            Tab 3 name is: cDescription

             

            As you suggested I modified the Previous Active Tab script 

            from

            The Previous Active Tab script captures the name of the Tab object:

            Set variable [$$PreviousActiveTab; Value: Get(TriggerCurrentTabPanel)]

            to

            Previous Active Tab script 

            Set variable [$$PreviousActiveTab; Value: GetValue (Get(TriggerCurrentTabPanel); 2)]

             

            Unfortunatelly, I still went back to tab 1 instead of tab 3.

             

            Thanks

             

             

            • 3. Re: Back Button Setup
              NaturSalus

              I have run the script debugger and I could see that 

              $$PreviousActiveTab = cIdentification 

              instead of

               $$PreviousActiveTab = cDescription

              • 4. Re: Back Button Setup
                NaturSalus

                As a matter of fact the value that the variable gets is not where you are but where you were one step before.

                So if I move to tab 1 and before I was in tab 8 it shows the value of tab 8 instead of tab 1

                • 5. Re: Back Button Setup
                  philmodjunk

                  You need the other function: get ( TriggerTargetPanel ) , not Get ( TriggerCurrentPanel )

                  OnPanelSwitch executes before the script changes to the new panel.

                  • 6. Re: Back Button Setup
                    NaturSalus

                    Finally working!smiley

                    Many thanks,

                    Jose