4 Replies Latest reply on May 4, 2012 12:11 PM by ahcho

    Switching between layouts in scripts

    ahcho

      Title

      Switching between layouts in scripts

      Post

      Hello!

      What is the purpose of the "original layout" option? 

      I understand the option is to target the original layout from which the script was run from. My question is, how do I invoke the original layout? Putting another button with the layout script w/original layout does nothing.

      What am I missing?

      Aaron

        • 1. Re: Switching between layouts in scripts
          philmodjunk

          This option for Go to layout is only useful within a script. It has no purpose as a single step option in Button Setup.

          Say you have this script:

          Freeze window
          Go to Layout [Details]
          Do stuff here
          Go to Layout [original layout]

          You can set up a button to run this script on a bunch of different layouts and they will all change to the details record, "do stuff" and then return to the layout where the button to perform this script was clicked.

          Note: If you are looking for a "back" button that will take a user to the previous layout, that can be done, but not with the "original layout" option.

          • 2. Re: Switching between layouts in scripts
            ahcho

            Regarding your bottom note, going back to the previous layout would utilize the summary/calculation funtions + variables? 

            • 3. Re: Switching between layouts in scripts
              philmodjunk

              Just a global variable or global field.

              The script that takes you to a different layout first enters the name of the current layout into the field/variable. The "back" button uses Go to Layout with the "layout name by calculation" option to refer to the name stored in this field or variable. It's even possible to set up code that Builds a return separated list of the layout names so that you can have forward and back buttons that work much like the same buttons in your web browser.

              • 4. Re: Switching between layouts in scripts
                ahcho

                Gotcha, thanks.