Requirment:
Need to add multiple sales line and financial dimensions on the sales order while creating it from AIF service in Dynamics AX2012 R3 from .Net
Solution:
For adding multiple sales line and financial dimension on sales order, I created 2 List classes that will support to add multiple lines “clsSalesLineList” & “clsFinancialDimensionList” for Sales line & Financial Dimension respectively.
The following code shows how I am adding the lines in salesorder:

Sales Line List class “clsSalesLineList”:

it is derived from its attribute class”clsSalesLineData” which is as follow:

Similarly for financial dimensions,
Financial Dimension list class “clsFinancialDimensionList”:

attribute class “clsFinancialDimensionData”:

Now lets get on the sales order creation code,
The below screen shows the signature of the method that will takes the list classes and also how it is iterating to add the multiple lines:

in the below code “order” is the object of “AxdEntity_SalesTable”:

in the next post I will be updating the Microsoft Dynamics AX2012 R3 AIF service to post the sales order as well.

#MicrosoftDynamicsAX2012 #AX2012 #SalesOrder #AIF #MultipleSalesLine #MultipleFinancialDimensions #AX2012R3 #.Net #Consume.NetC#
Thanks,
Happy Daxing with Rizz 😉
