OptionString in XML

MortenSteengaard
Member Posts: 144
I try to create a sales order using a standard web service. It works fine with items, but I cannot create sales lines that uses G/L Accounts. I write this in XML:
<Sales_Order_Line>
<Type>G/L Account</Type>
<No>1485</No>
<Description>Description</Description>
<Quantity>1</Quantity>
<Unit_Price>59</Unit_Price>
</Sales_Order_Line>
I get an error saying that the optionString does not exist. If I change the "Type" to "Item", it works fine.
How do I write "G/L Account" in XML?
<Sales_Order_Line>
<Type>G/L Account</Type>
<No>1485</No>
<Description>Description</Description>
<Quantity>1</Quantity>
<Unit_Price>59</Unit_Price>
</Sales_Order_Line>
I get an error saying that the optionString does not exist. If I change the "Type" to "Item", it works fine.
How do I write "G/L Account" in XML?
0
Best Answers
-
So, what value do you get for Type in the XML if you read a record with Type G/L Account from the page web service?
As an alternative, I guess the numeric option value should work (i.e. <Type>1</Type> in this case).5 -
Now I have read all the sales lines using my page to export it and show it in my browser. It turns out that the "G/L Account" optionString is shown as "G_L_Account". And when I use that value as input, everything works fine.
It does not work with the numeric value.
It does not work in you local NAV language (for me it is Danish).
It works if you change all spaces and special characters to underscore.
I didn't expect that, since the normal text fields in XML CAN contain spaces and '/'.
Thank you very much for your help.0
Answers
-
To get better idea of the XMLPorts just try to export the "G/L Account" type "Sales Line" in an XML format. You will get better understanding, using this approach.
You can also import the same file back to the system. So just edit it, put in the values and import it back0 -
Hi Azharsaeedkhan.
I use a copy of page 42 as a web service.
If I create a new XMLport with sales lines, I can easily import new lines like this:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<root>
<salesLine>
<DocumentType>Order</DocumentType>
<DocumentNo.>1019</DocumentNo.>
<LineNo.>50000</LineNo.>
<Type>G/L Account</Type>
<No.>1009</No.>
<Description>Sale of extra stuff</Description>
<Quantity>200</Quantity>
<UnitPrice>23,00</UnitPrice>
</salesLine>
</root>
So XMLports works fine. The problem is that my page won't accept the value "G/L Account" in the XML from the web. I use Widzler to enter the XML code in my browser, when I test this.0 -
So, what value do you get for Type in the XML if you read a record with Type G/L Account from the page web service?
As an alternative, I guess the numeric option value should work (i.e. <Type>1</Type> in this case).5 -
Yes, in that case you should try numeric value for optionstring.0
-
Now I have read all the sales lines using my page to export it and show it in my browser. It turns out that the "G/L Account" optionString is shown as "G_L_Account". And when I use that value as input, everything works fine.
It does not work with the numeric value.
It does not work in you local NAV language (for me it is Danish).
It works if you change all spaces and special characters to underscore.
I didn't expect that, since the normal text fields in XML CAN contain spaces and '/'.
Thank you very much for your help.0
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