Hi everyone,
I have a field named Project/Contract on Invoices and Memos (AR301000)

and I want bring this field to Grid on Customer Details screen

Could you please help me?
Thanks,
Khoi
Hi everyone,
I have a field named Project/Contract on Invoices and Memos (AR301000)
and I want bring this field to Grid on Customer Details screen
Could you please help me?
Thanks,
Khoi
Best answer by Naveen Boga
Hi
public class ARDocumentResultExt : PXCacheExtension<ARDocumentResult>
{
#region UsrCustomerOrderNbr
[PXString(50, IsUnicode = true)]
[PXUIField(DisplayName = "Customer Order Nbr")]
public virtual string UsrCustomerOrderNbr { get; set; }
public abstract class usrCustomerOrderNbr : PX.Data.BQL.BqlString.Field<usrCustomerOrderNbr> { }
#endregion
}
public class ARDocumentEnqExt : PXGraphExtension<ARDocumentEnq>
{
protected void ARDocumentResult_UsrCustomerOrderNbr_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
{
ARDocumentResult row = (ARDocumentResult)e.Row;
if (row != null)
{
ARDocumentResultExt resext = row.GetExtension<ARDocumentResultExt>();
ARInvoice invoiceObj = PXSelect<ARInvoice, Where<ARInvoice.docType, Equal<Required<ARInvoice.docType>>,
And<ARInvoice.refNbr, Equal<Required<ARInvoice.refNbr>>>>>.Select(Base, row.DocType, row.RefNbr);
if (invoiceObj != null)
{
e.ReturnValue = invoiceObj.InvoiceNbr;
}
}
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.