2 Replies Latest reply on Dec 6, 2012 1:27 AM by BradcMesser

    Import Records Script



      Import Records Script


           I just switched from my trusty old FM5.5 to FM12 and can't create an Import Records script that works. I have a Contacts file and a separate Invoice file. I need to open Contacts, find one record, then export that single record to Invoices so I have the client name and address there, and then enter numbers in the Invoice layout. This shouldn't be hard at all, right? I could have an Export Record script in the Contacts file, or an Import Record script in the Invoice file, but can't get either to happen. Where can I go to find out exactly how to do this? Thanks!

        • 1. Re: Import Records Script

               Import Records works much the same in FM 12 as it did in 5.5, but because filemaker files can now have multiple tables in each file, you have to also specify the table inside the file that will serve as the source and the table inside your current file that will serve as the target of the import.

               But I do not think that import records is the correct way to go here.

               Go to Manage | Database | Relationships in your Invoice file.

               Click the button in the bottom far left corner of this window to create a new table occurrence.

               Select "Add FileMaker Datasource" from the drop down, find your contacts file and select the correct table from the contacts file. You can now interact with this table occurrence as though the table from contacts were defined in your invoices table. I would then suggest you define a relationship linking an invoices record to a contacts record by Contact ID and use a drop down list or other similar selection method to select a customer for a given invoice. You can then either place fields from contacts on the invoices layout to show the current contact information or you can set up fields to use this relationship to lookup (copy) data from a field in the contacts layout. I recommend the latter option for invoices as that allows you to record the contact info that was current at the time the invoice was created. If a customer changes their contact info shortly afterwards, your invoice will still show the contact info that was current at the time the invoice was created and this can help troubleshoot delivery and billing issues.

          • 2. Re: Import Records Script

                 I really appreciate you telling me all that because I had no idea that FMP now does the multiple-table trick. Your advice is clear and logical. I'm off to play with my tables now. Thanks!