Importing Csv file into Navision

Hi exprts,

I am trying to import a CSV file from excel into navision table. Its is importing but its taking the records of only the last records for a particular Employee no. The employee no. is the primary key.

I have more than one records for each employee no, but the import is taking only one of these records mostly the last record and leaving the rest of the other records out i.e not imported.

How can i import everything into the table. Is there anything i am leaving behind?

Here is my dataport:

OBJECT Dataport 50019 Test
{
OBJECT-PROPERTIES
{
Date=20/11/07;
Time=16:26:10;
Modified=Yes;
Version List=;
}
PROPERTIES
{
OnPostDataport=BEGIN
MESSAGE(‘Import complete’);
END;

}
DATAITEMS
{
{ PROPERTIES
{
DataItemTable=Table5207;
OnPreDataItem=BEGIN
i := 1;
END;

OnBeforeImportRecord=BEGIN
“Employee No.” := FORMAT(i,10);
END;

OnAfterImportRecord=BEGIN
i := i+1;
END;

}
FIELDS
{
{ ; ;“Employee No.” }
{ ; ;“From Date” }
{ ; ;“To Date” }
{ ; ;Quantity }
}
}
}
REQUESTFORM
{
PROPERTIES
{
Width=9020;
Height=3410;
}
CONTROLS
{
}
}
CODE
{
VAR
i@1000000000 : Integer;

BEGIN
END.
}
}

Any idea please?

Thanks

Can you explain the reason for this line

“Employee No.” := FORMAT(i,10);

?

sorry, forget about that this is the one am using:

OBJECT Dataport 50017 Test
{
OBJECT-PROPERTIES
{
Date=20/11/07;
Time=16:19:02;
Modified=Yes;
Version List=;
}
PROPERTIES
{
FileFormat=Variable;
FieldStartDelimiter=None;
FieldEndDelimiter=None;
FieldSeparator=,;
OnPostDataport=BEGIN
MESSAGE(‘Import complete’);
END;

}
DATAITEMS
{
{ PROPERTIES
{
DataItemIndent=0;
DataItemTable=Table5207;
}
FIELDS
{
{ 0 ;5 ;“Employee No.” }
{ 6 ;7 ;“From Date” }
{ 15 ;7 ;“To Date” }
{ 25 ;5 ;Quantity }
}
}
}
REQUESTFORM
{
PROPERTIES
{
Width=9020;
Height=3410;
}
CONTROLS
{
}
}
CODE
{

BEGIN
END.
}
}

Thanks for all your reply. I have sloved it.

Thanks