Skip to main content
Solved

Adding Vendor InvoiceNbr to PO History on Purchase Order screen

  • Apr 17, 2025 12:13 AM UTC
  • 3 replies
  • 169 views
  • Translate All

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 Saikrishna V

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

View original

3 replies

Dipak Nilkanth
Pro III
Forum|alt.badge.img+14

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!

Translate

Forum|alt.badge.img
  • Author
  • Varsity I
  • Apr 17, 2025 6:32 PM UTC

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

Translate

Forum|alt.badge.img+4
  • Captain II
  • Answer
  • Apr 27, 2025 5:55 AM UTC

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

Translate