Hi,
I need to import some data saved in CSV file into T81 - Gen. Journal Line
File structure of CSV file is not identical to table structure.
How to import such CSV using XMLPort? Should I import first in Temp Table and then from temporary table to T81?
Thank you
BR Damjan
0
Answers
I managed to create XMLPort and at the moment there is also first record inserted into T81 - Gen. Journal Line, but this 1 record is header row in CSV, I need to skip that.
It inserts all columns from CSV file: "Column A" is inserted in first field element of the table "Gen. Journal Line", "Column B" is inserted in second field element on the table: "Gen. Journal Line", etc.
How can I skip fields that I do not need to insert -> CurrXML.SKIP -> this skip processing of XMLPort and closes the object, it does not skip the first row (header row).
And, there is one other thing, although I insert a new record with primary key on "Journal Template Name", "Journal Batch Name", "Line No." I get the error:
Microsoft Dynamics NAV
Break On Error Message:
The Gen. Journal Line already exists. Identification fields and values: Journal Template Name='TEST',Journal Batch Name='DZ',Line No.='10000'
OK
Thanks Damjan
After CurrXMLPort.SKIP code goes to the OnPostXMLPort() and exits the code, so that XMLPort is closed.
Code is attched in the printscreen
Thanks
I created new object XMLPort with identical code and it works as expected.
Thank you
BR Damjan