Skip to main content
Solved

Retrieve Detail Total value from Invoices tab

  • January 14, 2022
  • 2 replies
  • 67 views

Forum|alt.badge.img+2

Hi, 

I am trying to extract the value from Invoice  as it shown at screen 

But I need to take into account Reference Nbr of invoice from “Documents To Apply Tab”

So, I am going throw rows in Payment event which is called when user saves the Payment

  foreach (PXResult<AR.ARAdjust, AR.ARInvoice, PX.Objects.AR.Standalone.ARRegisterAlias, ARTran> gridRow in Base.Adjustments.Select())
                                {
                                    AR.ARAdjust _ARAdjust = gridRow;
                                    AR.ARInvoice _ARInvoice = gridRow;
                                 }

 But how to call necessary Invoice from this place ?                                  

Best answer by Naveen Boga

Hi @Ivan Please find the code below to fetch the Detail Total.

 foreach (PXResult<ARAdjust, ARInvoice, PX.Objects.AR.Standalone.ARRegisterAlias, ARTran> gridRow in Base.Adjustments.Select())
{
ARAdjust _ARAdjust = gridRow;
ARInvoice _ARInvoice = gridRow;

ARInvoice objARInvoice = PXSelect<ARInvoice, Where<ARInvoice.refNbr, Equal<Required<ARInvoice.refNbr>>>>.Select(Base,_ARAdjust.AdjdRefNbr);
if (objARInvoice != null)
{
var invoiceDetailTotal = objARInvoice.CuryLineTotal;
}


}

 

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • January 14, 2022

Hi @Ivan Please find the code below to fetch the Detail Total.

 foreach (PXResult<ARAdjust, ARInvoice, PX.Objects.AR.Standalone.ARRegisterAlias, ARTran> gridRow in Base.Adjustments.Select())
{
ARAdjust _ARAdjust = gridRow;
ARInvoice _ARInvoice = gridRow;

ARInvoice objARInvoice = PXSelect<ARInvoice, Where<ARInvoice.refNbr, Equal<Required<ARInvoice.refNbr>>>>.Select(Base,_ARAdjust.AdjdRefNbr);
if (objARInvoice != null)
{
var invoiceDetailTotal = objARInvoice.CuryLineTotal;
}


}

 


Forum|alt.badge.img+2
  • Author
  • Varsity I
  • January 14, 2022

Hi @Ivan Please find the code below to fetch the Detail Total.

 foreach (PXResult<ARAdjust, ARInvoice, PX.Objects.AR.Standalone.ARRegisterAlias, ARTran> gridRow in Base.Adjustments.Select())
{
ARAdjust _ARAdjust = gridRow;
ARInvoice _ARInvoice = gridRow;

ARInvoice objARInvoice = PXSelect<ARInvoice, Where<ARInvoice.refNbr, Equal<Required<ARInvoice.refNbr>>>>.Select(Base,_ARAdjust.AdjdRefNbr);
if (objARInvoice != null)
{
var invoiceDetailTotal = objARInvoice.CuryLineTotal;
}


}

 

Thanks a lot for your assistance