2 Replies Latest reply on Jan 10, 2011 11:58 AM by philmodjunk

    Import from separate files does not work

    RichardG_1

      Summary

      Import from separate files does not work

      Product

      FileMaker Pro

      Version

      Advanced 11.0v2

      Operating system version

      Win 7 up to date

      Description of the issue

      In my order database file are tables Orders and OrderItems.
      A separate file contains tables Invoices and InvoiceItems.

      To build a new invoice via script, I Find the Order, and Find the child OrderItems. Then, from the Invoice file, I import from Orders into Invoices. Then from the layout for InvoiceItems I import from OrderItems. Each in separate sub-scripts.

      The imported records are usually incorrect. Sometimes I get just the found set OK, but more often the entire set gets imported. With 100K Orders and 200K OrderItems, that not only dumps huge numbers of records into my Invoice file (screwing up all my auto-fill calcs), but it takes a few minutes to do it.

      The import Adds records, and uses "Matching names" -- the field names are exact matches and don't change.

      I've tried bringing the Source TO layout to the front, and making sure the script starts with the Destination TO layout selected.  I've yet to figure out when it works and when it doesn't (until it succeeds / fails).

      I've spent maybe 12 hours trying different things, and checking the KB and Forums. This seems similar to other Import Found Set problems.  Is it?  Is there a workaround?

      Workaround

      I'm about to try putting an Invoice portal into my Order file, with Allow creation, and then 'pushing' the records through the portal to create them in Invoice. Fingers crossed.

        • 1. Re: Import from separate files does not work
          RichardG_1

          Issue resolved.

          I still don't know why the imports sometimes showed all records, instead of just the found set.

          It was resolved by setting up two more Table Occurances - one each for Orders and OrderItems.

          Then the appropriate records were selected in those TOs.  The imports into Invoices and InvoiceItems worked as advertised.

          Maybe this will help someone else.

          • 2. Re: Import from separate files does not work
            philmodjunk

            Each table occurrence has it's own found set. Thus if you perform a find on a layout referencing Table Occurrence A, but import by selecting Table Occurrence B (with both referring to the same data source table), you will get the found set current for Table Occurrence B which might not be the same found set you created via Table Occurrence A.

            Also, if the file is closed at the time Import Records does its thing, you get the entire table instead of the current found set so that's another way this could happen, but your description of a script to find the records first would seem to preclude that possibility.