6 Replies Latest reply on Mar 12, 2014 4:31 PM by disabled_winfried

    Remembering what layout to return to

    trm1945

      Layout # 1 has boundaries so that setting the size to 100 or 150 or 200 percent ends up with a FileMaker display that stays within screen boundaries. Other layouts are in a list format so that setting these percentages will fill the screen vertically. What I want to do is: Store the present layout number. Goto layout number 1, set the percentage size. Return to the stored layout. How do you store a layout number?

        • 1. Re: Remembering what layout to return to
          erolst

          Like most stuff you want to use again later, you'd put it in a variable by using Get ( LayoutNumber ); then use that variable as result expression for the “Layout number by calculation” option of the “Go to Layout” step.

           

          Then again, that step also has an 'original layout' option …

          1 of 1 people found this helpful
          • 2. Re: Remembering what layout to return to
            rgordon

            You can use get functions to retrieve the info you need.

             

            Get(layout number) to get the layout number and Get(windowzoomlevel) to get the zoom level. You can set the values in a $$variable if the values only need to be remembered for the current session. If not you will need to store them in a field if you are using FM server or in a global field if you are using the file locally.

            1 of 1 people found this helpful
            • 3. Re: Remembering what layout to return to
              mcrip

              zoom level is a bit of pain to set.  Get(WindowZoomLevel) returns a number that represents the zoom percentage (so 200 for 200%).  But the Set Zoom Level script step doesn't accept that same number, you have to manually pick a zoom level (with the option of locking).  Which means a big If/Else If statement to reset the zoom level.

              • 4. Re: Remembering what layout to return to
                rgordon

                I'm all for doing things the most efficient way but sometimes it is easier and more efficient to send the 2 or 3 minutes it takes to write the big If/Else If statement and move on to the next problem.

                • 5. Re: Remembering what layout to return to
                  Mike_Mitchell

                  Possibly even creating a simple script that accepts the desired zoom level as a parameter. That script can then be pasted into any solution as a "function" (not a real function, of course) in a matter of seconds. This makes it easier if you have to do this particular operation many times in a given solution.

                  • 6. Re: Remembering what layout to return to

                    My solution to the problem many years ago was:

                    - create a table for the layouts in your main file

                    - after startup clear and fill that table with all available layout names and numbers in all files

                    - during normal operation remember the layout index you came from in a variable stack

                    - to go backwards (like in a browser) pop off the top layout index from the stack,

                       look up file and layout and go to that layout.

                     

                    The zoom level and page boundaries should be set at the time they are needed (for print, PDF creation, etc.).

                    I doubt they will survive a layout switch.

                     

                    -Winfried

                     

                    Added a comment referring to the zoom level. Message was edited by: Winfried Huslik