Skip to main content
Answer

Add vendor remit to AP301000

  • January 8, 2025
  • 3 replies
  • 65 views

Forum|alt.badge.img+1

Is there a simple way I can display the default vendor remit-to address to show on the bills and payments screen?  I’ve checked and the RemittanceAddress view does not appear in the Data View dropdown under Add Data Fields tab in screen editor.

 

Best answer by rjean09

Just got back to this and wasn’t too difficult.  Just added a new field and fill on RowSelected in APInvoiceEntry graph extension.

 

        protected void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
APInvoice row = e.Row as APInvoice;
if (row != null)
{
APInvoiceExtension rowExt = PXCache<APInvoice>.GetExtension<APInvoiceExtension>(row);
var vendor = Base.vendor.Current;

if (vendor != null)
{
// Fetch the Address record using the DefAddressID from the Vendor
var addressResult = PXSelect<Address,
Where<Address.addressID, Equal<Required<Address.addressID>>>>
.Select(Base, vendor.DefAddressID).FirstOrDefault();

var address = (Address)addressResult;

if (address != null)
{
string fullAddress = "";
if (!string.IsNullOrEmpty(address.AddressLine2))
{
fullAddress = $"{address.AddressLine1 ?? ""}\r\n" +
$"{address.AddressLine2}\r\n" +
$"{address.City ?? ""}, {address.State ?? ""} {address.PostalCode ?? ""}";
} else {
fullAddress = $"{address.AddressLine1 ?? ""}\r\n" +
$"{address.City ?? ""}, {address.State ?? ""} {address.PostalCode ?? ""}";
}

rowExt.UsrVendorContactAddress = fullAddress;
}
else
{
rowExt.UsrVendorContactAddress = null;
}

}
else
{
rowExt.UsrVendorContactAddress = null;
}
}
}

 

3 replies

Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • Answer
  • February 10, 2025

Just got back to this and wasn’t too difficult.  Just added a new field and fill on RowSelected in APInvoiceEntry graph extension.

 

        protected void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
APInvoice row = e.Row as APInvoice;
if (row != null)
{
APInvoiceExtension rowExt = PXCache<APInvoice>.GetExtension<APInvoiceExtension>(row);
var vendor = Base.vendor.Current;

if (vendor != null)
{
// Fetch the Address record using the DefAddressID from the Vendor
var addressResult = PXSelect<Address,
Where<Address.addressID, Equal<Required<Address.addressID>>>>
.Select(Base, vendor.DefAddressID).FirstOrDefault();

var address = (Address)addressResult;

if (address != null)
{
string fullAddress = "";
if (!string.IsNullOrEmpty(address.AddressLine2))
{
fullAddress = $"{address.AddressLine1 ?? ""}\r\n" +
$"{address.AddressLine2}\r\n" +
$"{address.City ?? ""}, {address.State ?? ""} {address.PostalCode ?? ""}";
} else {
fullAddress = $"{address.AddressLine1 ?? ""}\r\n" +
$"{address.City ?? ""}, {address.State ?? ""} {address.PostalCode ?? ""}";
}

rowExt.UsrVendorContactAddress = fullAddress;
}
else
{
rowExt.UsrVendorContactAddress = null;
}

}
else
{
rowExt.UsrVendorContactAddress = null;
}
}
}

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • February 11, 2025

Thank you for sharing your solution with the community ​@rjean09!


Forum|alt.badge.img+1

@rjean09 Thank you for sharing the solution. 

Tested the solution and it works.