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?
0
Answers
You can also import the same file back to the system. So just edit it, put in the values and import it back
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.
As an alternative, I guess the numeric option value should work (i.e. <Type>1</Type> in this case).
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.