Skip to main content

Hello Community,

I have customized the Relase AR Documents screen and showing the total (Amount column) at the Footer but screen is taking long time to load and gettting performance issue. Can you please review and help me with the code changes?

 public class ARDocumentReleaseNB_Extension : PXGraphExtension<PX.Objects.AR.ARDocumentRelease>
{
#region Event Handlers

protected virtual void BalancedARDocument_Availability_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
{
BalancedARDocument row = e.Row as BalancedARDocument;
e.ReturnValue = string.Concat("Total Amount: ", +Math.Round(Convert.ToDecimal(Base.ARDocumentList.Select().FirstTableItems.ToList().RowCast<BalancedARDocument>().Select(x => x.CuryOrigDocAmt).Sum()), 2));

}

 

 

 

@nsmith51 do I understand correctly that you’ve added ‘Availability’ field to the BalancedARDocument DAC?

In this case, your code will execute for each line that is displayed on the screen separately.

That is not what you want, right? Ideally you execute it once. So, I think you should put the value in some field in a PXFilterView and fill it from there.


Hi @Dmitrii Naumov Thank you for the response.

You mean to say, add the feild in the FilterVIew DAC and create a view delegate and write the code get the sum value of AMOUNT? but I did not find that VIEW in the ARDocumentRelease graph.

Can you please confirm if my understanding is correct.


@nsmith51 yes, something like that. The view you’ll need to create yourself. 


Reply