Deletion of record at import....

i have created a dataport for importing data into navision… it’s a semicolon separated text file… is there any way of deleting the record i have just imported into navision in the text file… so just the records not imported yet stays in the text file??? regards, Trond Solheim, NaviPartner

If you want to use the import-file as some kind of fifo-structure I think it sounds difficult. If on the other hand you deliberately choose to skip some records during the import i.e. the dataport doesn’t return errors, then why not write the skipped records to a new file and upon exit of the dataport delete the old file and then rename the new file to the name of the old file. Regards

I will suppose that you’re skipping records as Allan Ohlfsen said as if not all the import should be cancelled if having an error… or all the records will be imported… If you’re skiping records when importing it’s not difficult to do something similar… On the trigger onAfterImportRecord (where you’re probably skiping the record) just add the code for storing the records you’re not importing on another file (open the file on the onpredataitem trigger or so…). When finishing the dataport you can always add also code on the onpostdataport trigger for renaming the imported file and renaming the new file created with the imported file previous name, so you’ll have all the not imported records in the text file. Regards, Alfonso Pertierra (Spain)

Trond As Allan said write the NON Imported records to a file is the best way. But if you do not want to overwrite records already imported then. Example using the Item table C/AL Global Name:Item2 Type:Record Table:Item Trigger OnAfterImportRecord() // Code Start … IF Item2.GET(“No.”)THEN CurrDataport.SKIP; // Code End … If it finds the record in the table then skipes the Import. Remember if you are using variables as import fields use a THEN BEGIN & END; and CLEAR VARIABLES David Cox emai Edited by - David Cox on 2002 Jan 09 17:39:34