Data Conversion Problem while importing XML files

FarukcaFarukca Member Posts: 19
edited 2004-05-13 in Navision Financials
Hi,

I have problem on importing XML files.
The price data is like <Price>250</Price> in the XML file.

I am using this code to read from XML,

SalesLine.Amount := XMLLineNode.selectNodes('Price').item(0).text;

I can read it as a text data from the XML file.
But I can't convert it to decimal.

It returns an error like "Decimal := Text"

Any Help ?

Comments

  • Tommy_SchouTommy_Schou Member Posts: 117
    Farukca wrote:
    Hi,

    I have problem on importing XML files.
    The price data is like <Price>250</Price> in the XML file.

    I am using this code to read from XML,

    SalesLine.Amount := XMLLineNode.selectNodes('Price').item(0).text;

    I can read it as a text data from the XML file.
    But I can't convert it to decimal.

    It returns an error like "Decimal := Text"

    Any Help ?

    You need to use the evaluate function.. your code should be:

    evaluate(SalesLine.Amount,XMLLineNode.selectNodes('Price').item(0).text);
    Best regards
    Tommy
Sign In or Register to comment.