Skip to main content
Answer

Adding Vendor InvoiceNbr to PO History on Purchase Order screen

  • April 17, 2025
  • 3 replies
  • 76 views

Forum|alt.badge.img

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 ​@ashleyb 

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

3 replies

DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi ​@ashleyb,

I believe you’ll need to create a customization to achieve this.

You’ll need to create a custom field and pass the value from the base Vendor Ref. Nbr. field to your custom field.

Hope this helps!


Forum|alt.badge.img
  • Author
  • Varsity II
  • April 17, 2025

Can you tell me how I go about passing the value from the base to the custom field?


Forum|alt.badge.img+1
  • Semi-Pro III
  • Answer
  • April 27, 2025

Hi ​@ashleyb 

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