I have a requirement to add custom fields to the InItemLotSerial table. I have added an extension table to InItemLotSerial to accept custom values through the custom page.
I am accepting custom data for each serial number in InventoryItem

I have added the following event in POReceiptEntry extension to fill the value of custom fields from Inventory Item.
Base.RowInserted.AddHandler<ItemLotSerial>((sender, e) =>
{
var serialrow = (ItemLotSerial)e.Row;
if (serialrow != null)
{
InfoINItemLotSerialExtNV serextrow = PXCache<INItemLotSerial>.GetExtension<InfoINItemLotSerialExtNV>(serialrow);
InventoryItem itm = PXSelect<InventoryItem, Where<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>.Select(Base, serialrow.InventoryID);
if (itm != null)
{
InfoInventoryItemAttributeExtNV extrow = PXCache<InventoryItem>.GetExtension<InfoInventoryItemAttributeExtNV>(itm);
if (extrow != null)
{
serextrow.SearchType = extrow.SearchType;
serextrow.DiamondColor = extrow.DiamondColor;
}
}
}
});
While debugging the event is triggered and the values are assigned to custom fields, but it throws error while saving the purchase receipt.
`
`
