0

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

Fahad Ahmed
  • 63
  • 1
  • 1
  • 6

2 Answers2

2

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

Partial Update With AIF

Aliaksandr Maksimau
  • 2,251
  • 12
  • 21
0

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

Fahad Ahmed
  • 63
  • 1
  • 1
  • 6