What we want to do
We want to create both a sales header
and the corresponding sales lines
in one API call.
How we're trying to do it
To do this we're trying to do a deep insert as specified in the OData spec.
Example
POST http://our-nav-host:12202/NAV110_TEST/ODataV4/Company('CompanyName')/SalesOrder
{
"No": "1234",
"Sell_to_Customer_No": "1234",
"Sell_to_Customer_Name": "Test",
"Sell_to_Address": "Teststreet 56",
"Sell_to_Address_2": "",
"Sell_to_Post_Code": "1234",
"Sell_to_City": "Test",
"SalesOrderSalesLines": [
{
"Document_Type": "Order",
"Document_No": "1234",
"Line_No": 10000,
"Type": "Item",
"No": "21981"
}
]
}
We get a 200 OK
and the sales header
is created but without any sales lines
.
NAV Config
We have published a web service for page 42 (Sales Order) and we're using the corresponding OData V4 URL in the call.
SOAP
If we try to do the same with the SOAP URL and a SOAP-call it works. The sales order is created with the sales lines. But we would very much like to NOT use SOAP.