Fahad Ahmed
Fahad Ahmed

Reputation: 63

how to add a sales line using OOTB SalesOrder document service

I am trying to find an example to add a line to an existing sales order using the OOTB sales order service.

Our client is using the followings steps to do that but getting exception. I am trying to take a sales order that exists in AX with 1 sales line, and add another sales line to it.

1) I am using the update method on the SalesOrder service. 2) I set the entity action to update on the SalesTable 3) I set the entity action to update on the existing sales line 4) I set the entity action to create on the new sales line

What I get is "Invalid Entity action" regarding the new sales line. If I just update the SalesOrder and sales line without adding a new line it works great. I can't find any examples online about adding a line to an existing sales order. Any pointer or suggestion?

-Fahad

Upvotes: 0

Views: 157

Answers (2)

Fahad Ahmed
Fahad Ahmed

Reputation: 63

Following code helped me to write the code quickly to do that.

https://community.dynamics.com/ax/b/goshoom/archive/2014/10/28/delete-order-line-through-aif

Upvotes: 0

Aliaksandr Maksimau
Aliaksandr Maksimau

Reputation: 2281

You can find an example of how to create a new sales line in an existing sales order here:

Partial Update With AIF

Upvotes: 2

Related Questions