1 Reply Latest reply on Dec 26, 2011 8:44 AM by philmodjunk

    Best way for moving one table from one file into another file


      Best way for moving one table from one file into another file


       Got two files. File 01 is my main screen. Not related nor to File 02. File 02 is with multiple layouts and many scripts all related.   _i_ need one of its layout it's objects it's fields as a new layout in File 01. But now _i_ fear moving this related layout in File 02 over into File 01 is going to make everything related and workable in File 02 fall all apart. _i_ just want this related layout _i_ am moving to work from File 01 with what's going on with File 02.  What _i_ really need to do is go stand on my head and get the blood flowing !!!  rob 'jesus Land Tidd' Lewis

        • 1. Re: Best way for moving one table from one file into another file

          Fields belong to tables, which are then linked to layouts in "Show Records From" in layout setup. Thus, moving a layout from one file to another breaks the original connection to it's associated table. To do what you describe requires either moving the table into the other file (which can be done with Import Records if you specify "new table" as the target of the import.) or setting up an external data source reference in file 1 that links to the existing table in file 2.

          Most likely, you want the second option here as it will leave everything in file 2 fully functional as you will be making no changes to it's design. To set up a reference to the table in File 2, open Manage | database | relationships and click the button on far bottom left to make a new table occurrence "box". Select Add FileMaker Data Source from the data source drop down in the dialog box that pops up. This gets you an open file dialog where you can find File 2 and then select a table from it as the data source table for your new table occurrence.

          If  you give this new table occurrence exactly the same name as that found in File 2, you can create a new layout that specifies it in Show Records From. Then you can copy and paste your layout objects from file 2 into file 1.

          Note that there are two "gotchas" to that basic process.

          1) any fields, portals etc on the layout that refer to other tables in file 2 will be broken unless you also set up matching related occerrences of those tables in File 1 as well.

          2) Any scripted buttons, script triggers will be "broken" by the copy and paste. You'll need to import those scripts and update your buttons, script triggers on the new layout before they work.

          Please keep in mind that this all may not be necessary to do. You can have a script in File 1, that opens File 2 and selects the layout in File 2 that you want to bring over to file 1. The users may not even notice that you are changing back and forth between two different files.