8 Replies Latest reply on Nov 15, 2010 12:15 PM by RedL

    New Window with specific layout

    RedL

      Title

      New Window with specific layout

      Post

      When we create a new window, current layout will be duplicated at the new window before "Go to Layout".  How can I create a new window and load a specific layout?  I cannot use follow steps

      New Windows[]  (let we assume SalesOrder layout is here)

      Go to Layout["Products" (Products)]

      Because when Go to Layout["Products" (Products)] is executed the original layout (SalesOrder on my example) OnRecordCommit script will be trigged.  I do not want to trig the script.  The new Window is for my temporary data searching only.  I cannot commit SalesOrder before all of data is entered.

        • 1. Re: New Window with specific layout
          philmodjunk

          You may need to update your OnRecordCommit script to check a global variable and to not run when a specific value is set to the variable.

          Then you can use the Set Variable script step, to turn this OnRecordCommit triggered script "off", do your new window and then use another set variable step, to turn it back "on".

          Your OnRecordCommit triggered script might then look like this:

          If [ Not $$CommitDisabled ]

          //Your current script steps go here

          End IF

          Your new window script then becomes:

          Set Variable [$$CommitDisabled ; Value : True ]
          New Window
          Go To Layout
          Set Variable [$$CommitDisabled ; Value : False ]

          • 2. Re: New Window with specific layout
            RedL

            Yes, it is what I thought.

            The posted issue can be solve by following method.  But, I have issue.

            I always need Main window, which is on the desktop, and a working window, which is on the off screen invisible area, to do some data finding , sorting, .... I would like to keep the working window open all the time before user exit application.  How do I know the AP is exit by user, by clicking the close button on the left-top corner of my main windows.  I need to close the working windows when user close main window.

            • 3. Re: New Window with specific layout
              philmodjunk

              Do you have FileMaker Advanced?

              If so, you could write your own Close Window script and use Custom Menus to put it in place of the normal close window action. Your script can then close the working window whenever the main window is also closed.

              • 4. Re: New Window with specific layout
                RedL

                Yes, I have FMP Advance.  I do not use custom menu.  I will try.  Do you mean I can have a script for "exit AP" by custom menu and it will be trigged by my Main window left-top close button also? 

                • 5. Re: New Window with specific layout
                  philmodjunk

                  Closing the Main Window and exiting the application are two different actions.

                  When you exit the application, the working window will close automatically--so you don't need anything extra here.

                  You'd write a script to take the place of close window that checks the name of the window being closed to see if it's the main window, if so it then closes the working window also.

                  • 6. Re: New Window with specific layout
                    RedL

                    Where can I set the trigger of the close window?  Yes, as long as I can trig a script by closing any window, I do handle it.

                    • 7. Re: New Window with specific layout
                      philmodjunk

                      Clicking the close box in the corner of the window is the same as selecting Close Window from the File Menu. Thus, you modify the Close Window option in the File Menu to run your script instead and this script will run when you select it from the file menu or when you click the window button to close it.

                      • 8. Re: New Window with specific layout
                        RedL

                        I got it.  I will try it.  Thank you.