1 Reply Latest reply on Jun 3, 2017 8:10 AM by user1069

    Use script to import records without dialogue UNLESS records are skipped?

    RobRhodes

      FMP 12 - macbook pro - OSX 10.12.5

       

      Hi,

       

      I am using s simple script to import records from another database. I want to save myself a few clicks by setting the import records action to perform without dialogue UNLESS records are skipped due to an error.

       

      Is this possible?

        • 1. Re: Use script to import records without dialogue UNLESS records are skipped?
          user1069

          Yes, with caveats.

           

          The basics are as follows:

           

          Set Error Capture [ On]

          Import Records [No dialog]

          If [ Get ( Last Error ) ]

              Import Records [ ]

          End If

           

          The details are a little more involved. You have to decide what you want to do if records are skipped. You could delete the records that were imported (insert a "Delete All Records[]" step before the second Import Records[] step) and try again with the dialog on, but that's not going to give you much more information.

           

          I would import the records into a separate, buffer table, not the final destination. This allows you greater control over how to ultimately move those records into your data tables. If you're using a buffer table for your import you won't get skipped records during the Import step but rather during the processing step (that you would write to move the data into its final destination). There you could find out exactly which records were skipped and why.