8 Replies Latest reply on Jan 27, 2016 10:33 AM by russk68_1

    Back to previous Layout button?

    gowa

      Does anyone know a script to make a back to Layout button?

      I have a Calculator Layout that will be accessed from various other Layouts.

      I would like to place a back button on the Calculator Layout to move back to the previous Layout.

       

      Thanks.

        • 1. Re: Back to previous Layout button?
          BruceHerbach

          Hi

           

          Probably the easiest way is to store the starting layout name in a global variable.  Then have the back button goto the layout named in the variable and clear the global variable.

           

          HTH

          Bruce

          • 2. Re: Back to previous Layout button?
            gowa

            Bruce,

            I felt the breze as that flew over my head.

            • 3. Re: Back to previous Layout button?
              BruceHerbach

              Hi,

               

               

              Well lets try this.  A Global Variable is one that is available after a script has completed running and is available to any other script in the File. To define a Global variable start the variable name with $$ folllowed by what you want to call the variable.  So when you open the Calculator layout put a set Variable statement in a scriptbefore going to the calculator layout.  You will have to create/use a script to do the navigation and attach the script to the button that opens the layout.

               

              Open calculator Script

              Set Variable[$$LayoutReturn; Get ( LayoutName )]

              Go to Layout[Calculator]

               

              Script for the back Button on the calculator:

              Go to Layout[$$LayoutReturn]

              Set Variable [$$LayoutReturn;""]

               

              The second line clears the value of $$LayoutReturn as clean up. 

               

              If this is difficult you may want to take a look at some of the FileMaker Books or The FileMaker training Material.  Probably a good starter book would be FileMaker Pro 11 the missing manual by By Susan Prosser, Stuart Gripman.

               

              HTH
              Bruce

              • 4. Re: Back to previous Layout button?
                Mfun

                Bruce correctly says "is available to any other script in the File", the key word being File. If your solution uses mutiple files, then the global variable won't work, you'll need to use a global field instead. You only need to define the global field in one of your files, and your files will need to have an external reference to the file, but the beauty of global fields is you don't need to create a relationship to access it. Another option is instead of just going to the calculator layout, you could open up a new window and go to the layout. That way, the user can go to any layout and just bring the calculator layout into focus if it's already open. You can also optionally close the calculator window to bring the previous window and layout into focus. Also, if you're not keen on multiple windows and you want to have a generalised back (and forward button) similar to a browser, SeedCode have a free solution called BackMagic.

                1 of 1 people found this helpful
                • 5. Re: Back to previous Layout button?
                  gowa

                  Thanks Bruce.

                  • 6. Re: Back to previous Layout button?
                    russk68_1

                    Thank you!!!

                    • 7. Re: Back to previous Layout button?
                      RishiKhanna

                      Dont know if this helps I just have a button with Go to layout if you leave it blank it goes to original layout which i believe is the one you were on last

                      • 8. Re: Back to previous Layout button?
                        russk68_1

                        That was the first thing I tried but nothing happens.

                         

                        Thanks!