AnsweredAssumed Answered

Import (Update and Add New Records) Not Working

Question asked by Mitch on Nov 30, 2011
Latest reply on Dec 4, 2011 by Mitch

Title

Import (Update and Add New Records) Not Working

Post

The database I that records documetns and articles.  The main table, TITLES containes the ID number (TITLE_ID) and the title of each record (TITLE_TITLE).  Related to this table through ID's is two other tables DOCUMENTS and ARTICLES. These contain most of the record data feild for each article and documents added to teh database, with the expeption of the TITLE and ID field, which is from table TITLES. When I add a new document record in either the DOCUMENTS or ARTICLES layout, a record is automatically created in the TITLES table.

The process that has led me to this strucure is mentioned here: Change value list based on another field value

I have now created an import script to update exisiting records and add records from a laptop running a copy of the database.  The function is a typical import loop.

First, the import loop goes to the TITLES layout and imports records. It then proceeds to the DOCUMENTS layout and imports records.  This works fine as all existing records are updated and new records are added.  Including all the portal records associated with the DOCUMENTS table.  

The next step in the import loop is to go to the ARTICLES layout and import records.  However, even though there is are new records in the file used for the import, the new ecord does not appear.  But, if I open the ARTICLES layout, and select NEW RECORD, the title data that should have been imported (TITLE, TITLE ID) appears, without the remain data from the ARTICLE table.  Therefore the import did sort of work...well, the TITLES table at least, however it is not shown until I select NEW RECORD.  

I can not understand why the data is imported ok into the TITLES and DOCUMENT tables, but the ARTICLES table.

My import Script:

Loop

Go to layout ["TITLES" (TITLES)] 

Import Records [No dialog; "File"; Uodate exisitin; Mac Roman]

Unort Records

Got to Record/Request/Page [Last]

Set Next Serial Value [TITLES::TITLE_ID; SerialIncrement (TITLES::TITLE_ID;1)]

Go to layout ["ARTICLES" (ARTICLES)] 

Import Records [No dialog; "File"; Uodate exisitin; Mac Roman]

Unort Records

Got to Record/Request/Page [Last]

Set Next Serial Value [ARTICLES::ARTICLES_ID; SerialIncrement (ARTICLES::ARTICLES_ID;1)]

I have tried a number of things to fix this:  

I have cut down the import script to only import by updating records and adding new record the TITLES table first, then the ARTICLE table second. The same probelm exiists.

I have changed the imprt scirpt to a plain import records, TITLES table, then ARTICLES.  Same problem exisits.

I have also removed the 'Set Next Serial' set.  Same problem exists.

Outcomes