Hello - I received a request to add Vendor InvoiceNbr to the Purchase Order screen under the PO History tab but am not seeing this field as an option. Is there another way to go about getting this added?

Hello - I received a request to add Vendor InvoiceNbr to the Purchase Order screen under the PO History tab but am not seeing this field as an option. Is there another way to go about getting this added?

Best answer by svwk05
Hi
You can try updating the custom field from the Vendor's InvoiceNbr in the RowUpdated event using the code below.
protected virtual void POOrderPOReceipt_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
{
var row = e.Row as POOrderPOReceipt;
if (row != null && Base.Document.Current != null &&
!string.IsNullOrEmpty(Base.Document.Current.VendorRefNbr))
{
foreach (POOrderPOReceipt poLine in Base.Receipts.Cache.Cached)
{
POOrderPOReceiptExt rowExt = poLine?.GetExtension<POOrderPOReceiptExt>();
if (rowExt != null)
rowExt.UsrVendorRefNbr = Base.Document.Current.VendorRefNbr;
}
}
}Thanks
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.