4 Replies Latest reply on Dec 26, 2013 9:38 AM by vision

    Capturing Imported record count variable

    vision

      Title

      Capturing Imported record count variable

      Post

           FMP reports the number of records imported when it completes an import.  Can this variable be captured in a script?  I could not find a script function that grabbed this variable within FMP.  Thanks. 

        • 1. Re: Capturing Imported record count variable
          WBSimon

               When records are imported, the current found set are the records that are imported.  Import the records, set a global field or variable to the Get ( Found Count).

          • 2. Re: Capturing Imported record count variable
            vision

                 Thanks, but that is actually what I am trying to work around.  It is particularly problematic when no records are imported and if course FM simply would report the previous count of records being browsed as nothing has changed.  While I can script around this, I was hoping I could simply capture the variable from FM. 

            • 3. Re: Capturing Imported record count variable
              philmodjunk

                   I would expect that no records imported will return an error.

                   Experiment and see if you can use Get ( LastError ) to detect when no records were imported.

                   Either that, or you can use Set FIeld [ $OriginalCount ; Get ( TotalRecordCount ) ] to record how many records were present in the table before importing and then you can compare the value of $OriginalCount to Get ( TotalRecordCOunt ) after the import to get the number of imported records.

              • 4. Re: Capturing Imported record count variable
                vision

                     Thanks Phil. We do some complicated import schemes based n found records and I was trying to avoid programming a pre and post record count comparison for all the various files.   Interestingly, in the Script Debugger no error results are reported when no records are imported, but I will dig deeper in the FMP error codes to see if there is one.