title: Microsoft Dynamics AX 2012 - Purchase Price
body: <p>I've been instructed to create a customization on how the Unit Price (Purchline.PurchPrice) is calculated.</p>
  
  <p>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.</p>
  
  <p>For my customization, I'm going to be using 3 variables to determine the pricing.</p>
  
  <p>1: ItemId
  2: Current Session Date
  3: <strong>Customized Field in the Purchase Header</strong></p>
  
  <p>As such, I'll need access to <strong>purchline</strong> for the ItemId on the current line, and access to <strong>purchtable</strong> to access my field in the header.</p>
  
  <p>Right now there is a big process for how the pricing gets pulled from released products, how the system checks for discounts, etc.</p>
  
  <p>My question is, can anyone suggest the best class/location to check and modify where my final <strong>PurchPrice</strong> field gets set and inserted into <strong>purchline</strong>?</p>
  
  <p>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 &amp; PriceConvert classes, SalesPurchLine map, the modified method of the ItemId field of the form.</p>
  
  <p>AxPurchline doesn't seem to be triggering at all when I put breakpoints in them and create new purchase order lines.</p>
  
  <p>Any help, insight or advice on where it would be the best to make logic changes for the PurchPrice field would be greatly appreciated.</p>
  
  <p>Thanks in advance!</p>