axaptamicrosoft-dynamicsdynamics-ax-2012purchase-order

Microsoft Dynamics AX 2012 - Purchase Price


I've been instructed to create a customization on how the Unit Price (Purchline.PurchPrice) is calculated.

Right now when I'm creating a new purchase order and select an item, it simply pulls from the pricing from the released products for that particular item.

For my customization, I'm going to be using 3 variables to determine the pricing.

1: ItemId 2: Current Session Date 3: Customized Field in the Purchase Header

As such, I'll need access to purchline for the ItemId on the current line, and access to purchtable to access my field in the header.

Right now there is a big process for how the pricing gets pulled from released products, how the system checks for discounts, etc.

My question is, can anyone suggest the best class/location to check and modify where my final PurchPrice field gets set and inserted into purchline?

I need this to be basically the last part of the process of how this PurchPrice gets calculated. I've looked around in the PriceDisc & PriceConvert classes, SalesPurchLine map, the modified method of the ItemId field of the form.

AxPurchline doesn't seem to be triggering at all when I put breakpoints in them and create new purchase order lines.

Any help, insight or advice on where it would be the best to make logic changes for the PurchPrice field would be greatly appreciated.

Thanks in advance!


Solution

  • The table Purchline actually has a method called setPriceDisc where the price agreement is set and the line amount is adjusted.

    This seems to be the last place where PurchLine.PurchPrice is set.