How to import a decimal variable via an XMLPort


I haven’t had much opportunity to try out XMLPorts as dataports and am a bit stuck.

I have an already created Item Journal in NAV (Created from a Warehouse Physical Inventory Journal) and I want to update the Unit Cost on each line from a flat file (I do not want to change the Item Card details. These need to remain the same.)

The flat file consists of: “Item No.” “Unit Cost”. The Xmlport Format property is set to “Variable Text” and I have based this round the Integer table (With a filter of Number = 1).

I can write the code to find the Item Journal lines by item, Template Name and Batch Name and update them but I need to pass the Unit Cost into a variable on importing the file to do this, and I don’t know how you do this. The Source Types seem to only be Text, Table or Field.

This seems a fairly fundamental thing to do, so I am clearly overlooking something? [:D] How do you do this?

Many thanks in advance

PS Update - I can resolve the above using the EVALUATE function in my code, but am now stuck as to which table I should use. I was basing the Xmlport on the Integer table as I would with an old style dataport, but I get the error message “The Integer table is read only” when trying to import my test file. Any suggestions please?

Why you are using ‘Integer’ Table ? How System will import the record in required table ?

Why not use base table wherein you want to import the record.

take any other table u like for that matter… but use both item no and unit cost as variables … on after xmlport item… write your code to update the item journal line…

that is it!

it works…

ofcourse use auto save… to no auot update to no and auto replace also to no… just for safety…

Good luck…!