Formatting a numeric for an XML

AitorEG
Member Posts: 342
Hi everyone,
I am creating an XML file for deploy it into an external application. In the NAV record, I have a decimal value (Gross Weight (Kg), that I must write it on a node in that XML file.
I am using this for adding to the node:
I am formating to a text tyope, because the node as to be a text, but when processing the XML file in the external application, I see this error:
How can I use the format expression to generate a numeric node?
Thank you very much!
I am creating an XML file for deploy it into an external application. In the NAV record, I have a decimal value (Gross Weight (Kg), that I must write it on a node in that XML file.
I am using this for adding to the node:
lvl5XMlNode := XMLDocOut.createNode(1,'TOTALWEIGHT',''); lvl4XMlNode.appendChild(lvl5XMlNode); PackingHeader.CALCFIELDS("Gross Weight (Kg)"); DomTextNode := XMLDocOut.createTextNode(FORMAT(PackingHeader."Gross Weight (Kg)")); lvl5XMlNode.appendChild(DomTextNode);
I am formating to a text tyope, because the node as to be a text, but when processing the XML file in the external application, I see this error:
TOTALWEIGHT specified must be numeric
How can I use the format expression to generate a numeric node?
Thank you very much!
0
Best Answer
Answers
-
Solved using:
lvl5XMlNode := XMLDocOut.createNode(1,'TOTALWEIGHT',''); lvl4XMlNode.appendChild(lvl5XMlNode); PackingHeader.CALCFIELDS("Gross Weight (Kg)"); [b]Num2String :=FORMAT(PackingHeader."Gross Weight (Kg)"); Num2String := SELECTSTR(1,Num2String) + '.' + SELECTSTR(2,Num2String);[/b] DomTextNode := XMLDocOut.createTextNode(Num2String); lvl5XMlNode.appendChild(DomTextNode);
0 -
Be careful, it depends on your regional settings delimiterRegards,
Yury0 -
You're welcome. I'm glad it helps1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions