1 Reply Latest reply on Feb 23, 2009 3:45 AM by hiatts

    importing to multiple tables



      importing to multiple tables


      I'm just getting started with FM and could use some help.  Can someone point me in the correct direction.  I need to import sales orders into my filemaker DB.  The sales order in my FM DB consits of a Header table and an Order Lines table.  My text file from the external device capturing the sales order can be coded to identify what is a Header record and what is an Order Line record.  For example I can make a Header record begin with H and a Order Line record begin with L.  The records for both tables will contain the key for the Order table to tie the lines and header together.   Could a script allow me to import multiple tables and identify what records go to what tables?  A couple of hints to get me started would be greatly appreciated.  Thanks.

        • 1. Re: importing to multiple tables



          best to set up a temp table... (note it is a permanent table in your solution, but data is only prepped for import from here)... call is SalesOrders


          SalesOrder Header, and SalesOrder LineItem would be your normalised tables.


          Import the Sales Order to the SalesOrder table.

          Import the H to the Header table, and use an auto-enter key field, get the key value in a script.

          Import the L records to the Line Items table, setup a header key field, and update it to the value from the header.