2 Replies Latest reply on Jun 3, 2011 11:08 AM by LaRetta_1

    Close all tables except front script step ?

    jungovox

      Title

      Close all tables except front script step ?

      Post

      Is there a script step that simply close all open or related databases with exception to the active window/database ?

        • 1. Re: Close all tables except front script step ?
          philmodjunk

          No, but you can use the windownames function to get a list of all open FileMaker windows and you can then loop through them closing each one in turn.

          • 2. Re: Close all tables except front script step ?
            LaRetta_1

            I'm not sure why it matters what other files are open but, if you want to close all of your other files but the current one then you must be sure that the current layout (based upon your current table) does not have any fields on it from the other files and does not have any calculations from this table which references another file or external source.  Same holds true if there are conditional format calculations, portals, merge variables etc.

            In other words, when bringing all files in for a landing, it works best that the layout you are on when you fire this 'close all' script is null (blank layout only).

            Why is this important?  Because if you want to keep File A open but close File B but you have a field reference to File B on the current layout here is what happens:  Your script issues Close File [ File B ] ... but immediately after the script finishes closing File B, FileMaker notices that there is a reference to File B on the current layout and FM will open File B again behind the scenes!  You will never be able to close it until you issue an Exit Application.

            So be mindful where you are and what the current layout might be referencing.