Hi,
I have a query regarding dataport.
I have a text(csv) file which looks like this
No,Name,Address
Item No,Quantity,Price
Now i want to push 1st line to the customer table & 2nd line to the item table.
Please help me in this regard.
Thanks,
Vikas S. Shettar
0
Comments
If you have only 2 lines as you said your DataItemSeparator should be also <NewLine>.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Is there also a way to have 1 dataport to grab the first 3 columns of a CSV file and put them in a table in Navision, and 3 other columns of the same CSV file in another table? Or do i have to write 2 dataports for this?
Any help would be much appreciated
Maybe it is better to make a new topic.
You can make 3 variables and use them in the dataport fields. In the OnAfterImportRecord() trigger you can read the second table from a variable table and store the data in the table.
then define recored variable and 3 variables for 3 other fields (of proper type).
Define this other 3 vars as 4th 5th 6th dataport field (you have to type them).
then use proper trigger (onafterimport) to write simple code:
rTable2.Field1 := cdMyCodeVar;
rTable2.Field2 := tMyTextVar;
rTable2.Field3 := dcMyDecimalVar;
rTable2.INSERT;
be sure to empty variables before importing otherwise value from previous rec can be inserted.
BTW, as I can see now Mark was faster...
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯