Skip to main content
Question

Adding a field in Customer Details (AR402000)

  • February 2, 2026
  • 4 replies
  • 78 views

Forum|alt.badge.img

Hi, how do I add the Customer PO in Customer Details (AR402000)?

I want to add Customer PO below:

This is a custom field. SOOrder.UsrCustOrdExtra

To populate here:

 

I’ve tried going into Customization Editor → Graph:Documents, but the Customer PO isn’t there:

 

4 replies

  • Freshman I
  • February 2, 2026

Why “Customer PO” is not visible in Customer Details (AR402000)

You cannot see Customer PO because it does not exist in the main DAC used by AR402000.

AR402000 (Customer Details) uses ARDocumentResult as its main DAC

SOOrder.UsrCustOrdExtra belongs to SOOrder

Therefore, it will never appear directly in AR402000


 

Step 1: Add the field to ARInvoice (stored)

ARInvoice is linked to Customer Details, so we store the value here first.

public class BZARInvoiceExt : PXCacheExtension<ARInvoice>
{
    public abstract class usrCustPO : BqlString.Field<usrCustPO> { }

    [PXDBString(50)]
    [PXUIField(DisplayName = "Customer PO")]
    public string UsrCustPO { get; set; }
}

 

Step 2: Transfer value from SOOrder → ARInvoice

Add logic in SOInvoiceEntry to copy the value during invoice creation.

public class SOInvoiceEntry_Ext : PXGraphExtension<SOInvoiceEntry>
{
    protected void _(Events.RowInserted<ARInvoice> e)
    {
        if (e.Row == null) return;

        SOOrder so = PXSelect<
            SOOrder,
            Where<SOOrder.orderType, Equal<Required<SOOrder.orderType>>,
              And<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>>>>
            .Select(Base, e.Row.SOOrderType, e.Row.SOOrderNbr);

        if (so != null)
        {
            e.Row.GetExtension<BZARInvoiceExt>().UsrCustPO =
                so.GetExtension<SOOrderExt>().UsrCustOrdExtra;
        }
    }
}

 

Step 3: Add an unbound field to ARDocumentResult

ARDocumentResult is the main DAC for AR402000, so we expose the field here.

public class BZARDocumentResultExt : PXCacheExtension<ARDocumentResult>
{
    public abstract class usrCustPO : BqlString.Field<usrCustPO> { }

    [PXString(50)]
    [PXUIField(DisplayName = "Customer PO")]
    public string UsrCustPO { get; set; }
}

 

Step 4: Populate the field in ARDocumentEnq

Read the stored value from ARRegister and assign it to the inquiry row.

public class BZARDocumentEnqExt : PXGraphExtension<ARDocumentEnq>
{
    protected void _(Events.RowSelected<ARDocumentResult> e)
    {
        if (e.Row == null) return;

        ARRegister reg = ARRegister.PK.Find(Base, e.Row.DocType, e.Row.RefNbr);
        if (reg != null)
        {
            var ext = reg.GetExtension<BZARRegisterExt>();
            if (ext != null)
            {
                e.Row.GetExtension<BZARDocumentResultExt>().UsrCustPO = ext.UsrCustPO;
            }
        }
    }
}


Customer PO will be visible in Customer Details.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • February 2, 2026

Hi ​@Meri36 - Many thanks for your response. Is that dynamic to all types of documents in Customer Details? Ie. There are payment transactions, credit memos etc in that screen as well, not just invoice.


  • Freshman I
  • February 2, 2026

Hi, yes, Customer Details (AR402000) is dynamic and includes all AR document types (invoices, credit memos, payments, prepayments, etc.), because the screen is based on ARDocumentResult, which is a unified inquiry DAC.

The custom Customer PO field will only be populated for documents that have a relationship to a Sales Order:

Invoices created from SO → populated

Credit memos → populated only if they originate from an SO invoice

Payments and other AR documents → no SO reference, so the field will be blank

So the behavior is dynamic across all document types, but the value appears only where the data exists.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • February 2, 2026

Great to hear! I will give that a go an update once working, so everyone can use for future reference as well!