Skip to main content
Answer

Performance issue with displaying total amount at the footer

  • November 6, 2024
  • 3 replies
  • 45 views

Forum|alt.badge.img

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

}

 

 

 

Best answer by Dmitrii Naumov

@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.

3 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • November 6, 2024

@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.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • November 6, 2024

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.


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • November 6, 2024

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