Hi all,
I have a field updated event for soorder invoices screen Artran qty field which is used to get line weight by multiplying item weight and qty as below.
public PXSelect<InventoryItem> dataview;
protected void ARTran_Qty_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
var row = (ARTran)e.Row;
ARTranExt detail = PXCache<ARTran>.GetExtension<ARTranExt>(row);
foreach (PXResult<InventoryItem> result in dataview.Select()){
InventoryItem item = result;
if(item.InventoryID == row.InventoryID) {
detail.UsrItemWeight = item.BaseItemWeight;
decimal? LineWeight = row.Qty * detail.UsrItemWeight;
detail.UsrLineWeight = LineWeight;
}
}
}
usrLineweight is the custom field for Line Weight in details level of invoices screen. The line weight should be calculated just after qty field is updated. But it’s only working in the time when adding a new row. How can I solve this issue?
Thank you.