AnsweredAssumed Answered

Import script that imports more files than what is present....

Question asked by Mitch on Feb 20, 2011
Latest reply on Feb 25, 2011 by philmodjunk


Import script that imports more files than what is present....


I have a FMP 11 database I have been using for some time, and when I import data using an import script from a back up .USR file from an older runtime version of the SAME database it works fine, importing 19 out of 19 records, plus portal records.

If I save a back up copy of the FMP 11 database with the new data, in either a .fp7 or rename it to a .USR file, the database will flash a window saying it is importing a thousand or so records with a progress bar, counting down the records, when its finished the window and progress bar appears again saying it is importing several thousand records....  When its all finished, I end up with 19 out of 19 records, plus portal records...

There has been a minor change to the database and the import script to the FMP 11 database since the runtime version was made. Additions to the database:





Main_Text is a hidden calculated text field that combines both the data from and existing Text_Body and Text_Summary into a single field. New_Text is merely a new editable text field.  The change to the import scripts is a Loop (after the main import step) as follows:

Go to Record First


 If [not IsEmpty (Main_Page::Main_Text)]

 Set Variable [$MainText; Value:Main_Page::Main_Text]

 Set Field [Main_Page::New_Text; $MainText]

 End If

Go to Record [Next; Exit after last]

End Loop

Replace Field Contents [No dialog; Main_Page::Text_Body;""]

Replace Field Contents [No dialog; Main_Page::Text_Summary;""]

Apart from this the additional fields and import scirpt on both verisions of the database are the same.

The intention is that if the Main_Text field has data in it, the data is copied into the New_Text field.  Then the data in Text_Body and Text_Summary are deleted.  Any other subsequent imports will not alter or update the New_Text field, because the Main_Text will be empty due do an empty Text_Body and Text_Summary... well, like I said, that is the intention.

I assume I have stuffed up the script, but the solution is beyond me...