I am trying to get a newly added package to have the Shipment Number in the Customer Ref Nbr 1 field automatically.
To do this I added a fieldDefaulting event as follows:
protected void SOPackageDetailEx_CustomRefNbr1_FieldDefaulting(PXCache cache, PXFieldDefaultingEventArgs e)
{
var row = (SOPackageDetailEx)e.Row;
if (row == null) return;
e.NewValue = "SH#" + row.ShipmentNbr;
}
This works fine when I manually press to add a package but when I use auto pack it ends up with a field with: SH# <NEW> as I presume the row.ShipmentNbr is not populated at that point. What should I use to get the shipment number before it is saved?
Thanks for any advice,
Phil