Hi @Harshita ,
You are adding code to the DAC extension, this is not right. You can add custom fields to the DAC extension and not write an logic.
this code you need to add to the the graph. i.e. public class POOrderEntry_Extension : PXGraphExtension<POOrderEntry>
You need to extend POOrderEntry graph and add logic to transfer fields values from one screen to another.
public class POOrderEntry_Extension : PXGraphExtension<POOrderEntry>
{
protected void POLine_InventoryID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
var row = (POLine)e.Row;
if (row == null) return;
InventoryItem inventoryItem = PXSelect<InventoryItem,
Where<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>
.Select(Base, row.InventoryID);
InventoryItemExt inventoryItemExt = inventoryItem.GetExtension<InventoryItemExt>();
if (inventoryItemExt != null)
{
POLineExt rowExt = PXCache<POLine>.GetExtension<POLineExt>(row);
rowExt.UsrCustomField = inventoryItemExt.UsrCustomField;
}
}
}