Blog

Microsoft Dynamics AX Blog

1

If you ever called the AIF Sales Order Service in Dynamics AX 2009, then you had to specify the Customer Requisition (PurchOrderFormNum) field in SalesTable although this field is not really mandatory.

The Sales Order web service assumes that it is called from trading partners applications. Thus, whenever a sales order is created, this means that it has been created based on a request (Purchase Requisition most of the time) by this trading partner to your organization. And this requisition should be recorded in the PurchOrderFormNum field.

But why does the AIF Web Service create Journal type sales order then? The AxdSalesOrder class (the AX Document class) checks whether this sales order has been requested before by this customer (CustAccount field) or not. If it has been requested before, then this means that this customer (the one who sent this sales order document via the AIF Sales Order service) is purchasing based in the same Sales Order.. so Dynamics AX does not need to create another sales order, it creates Journal type sales order instead for the same customer and the same Customer Repulsion.

A great detail of the Sales Order Document Service is found in this link: http://msdn.microsoft.com/en-us/library/cc967401.aspx.

You might face the same scenario that I’m facing with one of my customers currently, that is migrating sales orders from an internal legacy system where you want only to migrate sales orders without checking for a Customer Requisition. If this is what you’re looking for, then all what you have to do is to comment the code in AxdSalesOrder class and prepareSalesTable method:

select firstonly localSalesTable
where 	localSalesTable.CustAccount 		== _axSalesTable.parmCustAccount() &&
	localSalesTable.PurchOrderFormNum 	== _axSalesTable.parmPurchOrderFormNum() &&
	localSalesTable.SalesId           	!= _axSalesTable.parmSalesId();
 
/*COMMENT FROM HERE
if (localSalesTable)
{
	_axSalesTable.parmSalesType(SalesType::Journal);
}COMMENT TO HERE*/

Dynamics AX 2012 Event

Recent Posts

Tags

Archives

Random Testimonial

  • ~ Shibu Purushothaman, Sr. Programmer at WorleyParsons

    0bd63bf"Working with Amer was a pleasure. He is a true professional with in depth knowledge of Dynamics AX, .Net and other Microsoft Technologies. His professional approach to design, implementation and training made our migration to Axapta easy, and with very little down time. Another quality that I think deserves a special mention is that working with him is a pleasure, not even once did we feel uncomfortable with Axapta even though we were from a .net platform. He took time to attend to our doubts, and made the transition from .net to Axapta a very smooth ride. I highly recommend Amer and cant wait to work with him again."

  • Read more testimonials »