4 Replies Latest reply on Feb 16, 2011 11:27 AM by sharontricorp

    Moving records between tables

    sharontricorp

      Title

      Moving records between tables

      Post

      Hi all. I was wondering if it is possible to automatically move a record from one table to another using a script. We are trying to simplify our inventory so we have split off our inventory into 2 tables, one for active equipment and one for disposed equipment. We are trying to make it so that based on a specific change of a numeric value in our active table the record transfers over to the disposal table. Is this possible? Thanks in advance.

      Sharon

        • 1. Re: Moving records between tables
          philmodjunk

          It's certainly possible. Import Records can move data from one table to another--even tables in the same file, but why not just add a status field where you select either "active" or "disposed". That can be a much simpler approach to implement.

          • 2. Re: Moving records between tables
            sharontricorp

            I have been having trouble importing just one record without having to recreate a file. We have about 10000 records in one table. I am not very advanced with FileMaker yet so simple tasks are still a bit out there for me. I just started working with this file that is about 10 years old and not user friendly at all because of how it was set up here. The reasoning behind the separate table has to do with how we reconcile our inventory and because my boss wants to just see what is active without having to call up the records and omit our disposals.

            • 3. Re: Moving records between tables
              philmodjunk

              Scripts, layouts, etc. can be designed so that your reports and your boss only see the current inventory records. Using Script triggers, these scripts can kick in automatically when you open a specific layout or when you leave browse mode (after performing a find, for example).

              Import records imports all the records of your current found set. You can create a new table as part of the import if you use the new table option, so if you insist on dividing your data into two tables, this can be an easy way to set up the initial table for disposed inventory.

              I suggest reading up on Import Records in the FileMaker Help system. There are a lot of options. Also make frequent back ups when you are trying this feature out so that you can start over if you make a mistake.

              To create your new table for disposed inventory: Perform a find to pull up all records for disposed inventory in your found set. Select Import Records from the File Menu, select the same file you already have open. Specify your current inventory table as the source table. For the target table, select the New table option at the bottom of this list. When you perform this import, all disposed inventory records will be imported into your new table.

              For subsequent imports, Pefrom a find to get just the disposed inventory record in a found set of just that one record. Go To a layout for the disposed inventory table and do your Iimport Records action from there--using the Matching Field names option to make sure that all fields in your source table correctly map to the correct table in your target table.

              Once you can do this manually, you can do the same steps in a script.

              In scripting, using the Matching Names option is important, it avoids an ancient FileMaker bug that can scramble your imported data during import after you have added/removed field definitions from one of the tables.

              • 4. Re: Moving records between tables
                sharontricorp

                I'll give it a try! Thanks so much for your help.