Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

How to get the NetPrice in the Purchase Order

$
0
0

My requirement is to create a Purchase order on the basis of Barcode, like I've created a new text field in 'PurchLine' by extending it named 'Barcode2' and by entering the barcode, according to requirement I have to update the line by populating the "ItemId" and "Unit" filed correspondence to the 'Barcode2' field, and it's in the system functionality to automatically update its related fields in the line, but now line is updating some fields but the 'NetPrice' and 'Quantity' field are not updating.
How I can get the value value of NetPrice ?

Here is the code that I've written,

internal final class CfzPOCreation_EventHandler
{
///// <param name="sender"></param>
///// <param name="e"></param>
[DataEventHandler(tableStr(PurchLine), DataEventType::ModifiedField)]
public static void PurchLine_onModifiedField(Common sender, DataEventArgs e)
{
EcoResProduct ecoResProduct;
Purchtable purchtable;
InventDim inventDim;
pricedisctable pricedisctable;
inventtablemodule inventtablemodule;
PriceDisc priceDisc;
ModifyFieldEventArgs event = e as DataEventArgs ;
FieldId fieldId = event.parmFieldId();
PurchLine purchLine = sender as PurchLine;

switch(fieldId)
{
case fieldNum(PurchLine,CfzItemBarCode):
InventItemBarcode itemBarcode = InventItemBarcode::findBarcode(purchLine.CfzItemBarCode,false,false);
purchLine.ItemId = itemBarcode.itemId;
purchLine.PurchUnit = itemBarcode.UnitID;
purchLine.BarCode = itemBarcode.itemBarCode;

break;
}

}

}


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>