CRUD Purchase order using AIF in Dynamics AX 2012 R3
Due to Purchase order doesn’t have Standard document service so we have to create new Document service for that using AIF wizards.
I’m using AIF document service with
HTTP Adapter to Create Purchase order service, here is steps
with three datasouce (
PurchTable, PurchLine, InventDim) likes below
As best practice for Document service, name of query should be start with Axd* prefix.
Using AIF Wizards
In AX development environment, go to Tools > Wizards > AIF document service wizards
Choose recent created query and click next.
Create Service operation and
next and then
You will get service project in Private project
Deploy and create service
• Right click on
PurchOrderService > Add-Ins > Register service
• System administration > Setup > Services and AIF > Inbound ports
Inbound ports form and name the Service.
• Adapter: NETTCP (it also works with HTTP adapter)
• In Service contract customizations fast tab click
Active recent created Service
Consume service using C#.NET
After service is activated, you can get WSDL URI likes
Create console project and Add Service References, the code below
In Class, I will write method to return list of
Code for create purchase order
Code for read purchase order
Code for update purchase order
Code for delete purchase order
Thank you for reading!