Requirement:
To create and post a credit note in Microsoft Dynamics AX2012 R3 from AIF Service.
Solution:
In out of the box we do not have any Service which will create credit Note of the sales Order in Microsoft Dynamics AX2012 R3. To overcome this requirement I created a new Table with the following Fields:

And create a new query in which I define the above table as the datasource of that query and simply create the new document service from that query:

Once you create the AIF document Service, open the service class and modify the Create Method as above in which I am calling the “postCreditNote()” method that will create the credit note and post it. And the loop if the call has multiple lines.
PostCreditNote:


Now when the create service method will be called from any source after logging in the Credit Note Table it will create the CreditNote and Invoice the CreditNote as well in Microsoft Dynamics AX2012 R3.
Thanks,
Happy Daxing with Rizz π
#MicrosoftDynamicsAX #AX2012 #R3 #CreditNote #AIF #CreateAndPost
