Skip to main content
Solved

Add vendor remit to AP301000


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;
                }
            }
        }

 

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+1
  • Author
  • Semi-Pro III
  • 77 replies
  • 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
  • 2749 replies
  • February 11, 2025

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


Forum|alt.badge.img

@rjean09 Thank you for sharing the solution. 

Tested the solution and it works. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings