6 Replies Latest reply on Apr 30, 2013 4:13 PM by beano129

    Setting up a 'Back Button' (using previous post information as the guide)

    beano129

      Title

      Setting up a 'Back Button' (using previous post information as the guide)

      Post

           Morning all, 

           I'm trying to set up a button that returns to user to the previous screen. 

           I've been referring to the following post: http://forums.filemaker.com/posts/e46f9eba67 

           I've gone through the FILE - MANAGE - LAYOUTS and added the OnLayoutExit script trigger on each layout to which users have access: Set Variable [$$Prevlayout ; value: Get ( LayoutName ) ]

      Then, on the 'BACK' button, I've done the following Use the "layout name by calculation" option, then used  Go to Layout: [$$PrevLayout]

           I've done all of this but sadly I can't seem to get this going on FMP12 - am I missing somthing? 

           Thanks all

            

        • 2. Re: Setting up a 'Back Button' (using previous post information as the guide)
          beano129

               Thank you for this David, 

               out of curiosity, how do you install them? I've never downloaded any plug-ins or add-ons for FMP12.. i have a man and have downloaded the file but all it seems to do is bring up a little box that esstnially shows you how it works.. have I actually installed it now? 

          • 3. Re: Setting up a 'Back Button' (using previous post information as the guide)
            schamblee

                 You will need to set your variable $$PrevLayout to another Variable such as $Prev in your back button then use $prev in your go to Layout [$Prev]..

                 The exit trigger is firing after you enter the new layout so it reset to itself, so if you set the variable to something else before it reset it will work. 

                 Here is a sample app

            https://www.sugarsync.com/pf/D9559058_790_081846897

            • 4. Re: Setting up a 'Back Button' (using previous post information as the guide)
              beano129

                    

                   Hi all, I still seem to be struggling with this so I thought I'd write out the steps I followed and see if you can spot where I'm going wrong... 

                    

              Button

                   Right click the button in the edit layout mode and enter the 'Button Set-up' window

                   In the button set-up window I choose GO TO LAYOUT in the left-hand column and then on the right-hand column, in the Specify Option drop down, I choose LAYOUT NAME BY CALCULATION

                   When the SPECIFY CALCULATION box appears, in the lower calculation field i have typed "$$Prev"

                   I then press OK, return to the Button Set-Up window and press OK again. 

                    

              Layout

                   I click FILE - MANAGE - LAYOUTS 

                   When the MANAGE LAYOUTS window opens, I click the EDIT button on the 1st of my 4 layouts. 

                   When the LAYOUT SETUP window pops up, I click the Script Triggers Tab. 

                   In the EVENT section, I scroll down to OnLayoutExit and TICK that option. 

                   Next, I click the SELECT button and i get the SPECIFY SCRIPT window pop up. 

                   Here, I add a new script and in the EDIT SCRIP window that pops up, I scroll to the SET VARIABLE option in the left-hand column, MOVE it over to the right hand side and then click the SPECIFY button. 

                   Next, when the "Set Variable" options window pops up, in the NAME: section i have typed "$$Prev"

                   Then in the VALUE: section, I press the SPECIFY button and bring up the SPECIFY CALCULATION window. 

                   I then typed "Get (LayoutName)" in the bottom section and then press OK

                   Then I return to the "Set Variable" Options window and again I just press OK

                   Finally, I return to the Edit Script Window and again press OK

                   (Now, the calculation in the EDIT SCRIPT window reads… "Set Variable [$$Prev; Value:Get (LayoutName)]  - is this correct?) 

                   Lastly I added the the scrip to each of the 4 layouts that I've got. 

                    

                    

                   Is this correct or am I misinterpreting somthing? 

                    

                   Thanks all

              • 5. Re: Setting up a 'Back Button' (using previous post information as the guide)
                schamblee

                     Set a script trigger on each layout OnLayoutExit to preform a script the following 1 line script

                set variable[$$PreviousLayout;Value:Get(LayoutName)]

                     Create a back button with a script with the following 2 line script

                set variable[$Back;Value:$$PreviousLayout]
                     go to Layout[$Back]

                     I used $Prev as example but when I created the sample app I used $Back.  It don't matter which you use.   This variable doesn't have to be global.  the variable used in the OnLayoutExit is the only one that need to be global.

                     You can import these script from the sample app.

                      

                • 6. Re: Setting up a 'Back Button' (using previous post information as the guide)
                  beano129

                       Ok something is going pretty badly here becase I just can't get this working at all... would I be able to email someone my file so they can see what i'm doing wrong? 

                       I just can't seem to get my head around this and see what's going wrong. 

                       Many Thanks 

                       Rich