Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

OData POST (insert) order lines

$
0
0

Hello,

I am trying to insert whole orders in D365fFO using an external web application, which takes the products and their variants from D365 using OData. My idea of doing this is making POST requests to OData, first to entity SalesOrderHeadersV2, then for each line in the entity SalesOrderLines. All is done by using c# types WebRequest and HttpWebResponse, I can present code snippets but they are long, so I am not putting it here now.

What is happening is, that the Order header where I am sending only values of two fields "OrderingCustomerAccountNumber" and "DataAreaId" gets inserted and is to be seen in D365. It also returns the generated order number in the response, along with the expected result code 201 Created.

The lines are however not to be seen in D365. The code reports no errors, the reply to each line is also 201 Created, but when looking in D365 the inserted headers look like they did not contain the inserted lines. I am filling the fields "SalesOrderNumber" and "dataAreaId" according to the returned order header, "ItemNumber" and "OrderedSalesQuantity" according to the line in the external DB and if there is data for them present also the fields "ProductSizeId", "ProductColorId", "ProductStyleId" and "ProductConfigurationId". Those are supposed to specify the product variant.

Does anybody see a reason for the sales lines not appearing in D365 using this process? Did I forget to fill out any mandatory fields in the sales lines? Thank you in advance for any help!


Viewing all articles
Browse latest Browse all 143529

Trending Articles