3 Replies Latest reply on Nov 14, 2011 2:47 PM by databuzz

    Opening External Files


      Thought I would ask a question that's been bugging me lately and test the new forum at the same time.


      I'm working on a FileMaker Pro v11 file for the iPad that is essentially an interface file with file references to the data files back at the office - it's used for staff when they're out of the office to perform some quick tasks. I'm trying to manage the point at which it opens the external files and can't find any documentation around this, but essentially I'm after the list in order of precedence about when FileMaker Pro/Go will require a file that is referenced via an external data source to be opened. Obviously if there are fields on the layout that you are currently on or performing a subscript in one of the external files etc but I'm starting on a blank layout attached to a local table occurrence with nothing on it yet before the OnOpen script gets to the first step the external files are opened. I'd like to not have these open at this point as I need to setup some local accounts first that will then open the external files without requiring the user to enter their account name/password multiple times for each of the 5 external files.




        • 1. Re: Opening External Files

          Hiya Andrew


          That's an interesting question because I have just encountered a similar problem which I think is caused by the same process.


          If it is a blank layout, and therefore there are no fields on the layout, nor any other object that will force the related files to open as hidden files, I would have expected that related files would not be opened, hidden or otherwise, until something triggered the opening such as a related field or a script trigger on the layout.


          The problem I am experiencing is between two files. File One is an interface file which upon opening displays a layout with only graphic objects on it. These objects are defined as buttons to open other files. This file also has a number of external data sources as well as TOC's to other files including File Two.


          File Two does not visibly open until the required button is clicked nor does it open as hidden.


          If File Two is closed after having been opened, it reopens as hidden. This behaviour has only started since I added the relationships to File One together with portals and related fields in File Two on a layout (not current) in File One.


          Note: this behaviour occurs whether opening the files using FileMaker v8.0 or FileMaker v11.0 and on a Mac.


          I'm most interested to hear more.




          • 2. Re: Opening External Files

            Hi Andrew and Linda,


            When a file is opened, FileMaker instantiates the join cache. To do this, it walks the Relationships Graph, and in so doing, is apt to open External Data Sources that are referenced (ie have TOs placed) on the Graph of the file you're opening.


            So if you don't want an external file to open when your first file opens, you may need to ensure that the graph doesn't have any TOs pointing to the external file.


            Simlarly, there are cases when a script loads for execution where references (to fields, and also to external data sources) will be validated (pre-flight), so an external file may open before the scipt step addressing it is reached. To solve that, you may want to put the step that addresses the external file into a sub-script to ensure it won't load until you're ready to run it.


            In some cases, given all of the above, it's best to use a separate "starter" file (that doesn't require graph references to any of the other files) to manage the prep work and then bring the other files up at the appropriate point.


            Hope that gives you both enough pointers to pick a path through to the outcomes you're looking for.





            R J Cologon, Ph.D.

            FileMaker Certified Developer

            Author, FileMaker Pro 10 Bible

            NightWing Enterprises, Melbourne, Australia



            • 3. Re: Opening External Files

              Hi Ray and Linda,


              Thanks for posting - I created this during the beta testing in September and didn't get any replies so it's great to see my dormant topic getting some activity after 2 months


              Ray - I'm working on a solution with 29 files. When I open the main file using FileMaker Pro Advanced it opens 9 files in total which is what I expect based on the startup script, opening layout etc. There are TOs on the graph of this main file to all 29 files - if I open the graph it then opens all 29 files as expected (I'm checking using the FileMaker Server Admin Console to see how many files I have open which also corresponds to the contents of the Window menu). You mentioned that FileMaker "opens any External Data Sources that are referenced (ie have TOs placed) on the Graph of the file you're opening" - I'm not seeing that in this case.


              However when I open my interface file that I've created for use with FileMaker Go it definitely opens all External Data Sources that are referenced on the Graph.