Dataport, how do you update the imported record with Date Imported etc

I am importing into NAV2009 R2 to a new table.

I need to populate the Date Imported field after the record has been added.

Is this possible without resorting to a full variable import?

Currently I have the list of fields and not had any success with finding the imported record and updating it.

perhaps the question is not clear? why not add
“Date Imported” := today;

Tried that, did not work.

That is why I am puzzled.

how about

“Date Imported” := today;

Tried that, as per the following:

Salesperson/Purchaser - OnAfterImportRecord()

“Salesperson/Purchaser”.“Imported Date” := TODAY;


Error message:


Microsoft Dynamics NAV Classic


Salesperson/Purchaser Code ‘EUN0681’ does not exist.

I have tried several variations but the only one that works is to use an integer as per the following example:

Integer - OnAfterImportRecord()

IF ImportText[1] = ‘Account Type’ THEN CurrDataport.SKIP; //skip the 1st record if it has the column header


IF ImportText[5] <> ‘’ THEN


IF Amt <> 0 THEN CreateGenJnlLine(Amt);

CurrDataport.SKIP; //Finished with Lines

Integer - OnPostDataItem()

CreateGenJnlLine(Amt : Decimal)

LineNo += 1000;


GenJnlLine.“Journal Template Name” := ‘GENERAL’;

GenJnlLine.“Journal Batch Name” := ‘TBLOAD’;


The problem with this is the time to set up the ImportText[1] to [99] fields.

Still, it looks like this is the only way?

So you are importing Salesperson/Purchasers?

Are all of these records NEW? or are you updating existing Salesperson/Purchasers?

Why would you need a “Date Imported” field for a salesperson/purchaser?

Why not a “Creation date” where you could add Oninsert of the table “creation date” := today;

Did you try instead of modify;

if not Insert then modify;


That was a quick example, not real.

I exported 2 records, changed the Code value and then imported them as new records.

Simple little example to test the principle of modifying a record once it had been imported.

My real task is for several ‘log’ files that will have incremental data added on a regular basis and a need to keep track of date, time and userid when imported.

I am still waiting for a solution I feel.