Skip to main content
Solved

Performance issue with displaying total amount at the footer

  • November 6, 2024
  • 3 replies
  • 19 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.

View original
Did this topic help you find an answer to your question?

3 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 632 replies
  • 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
  • 55 replies
  • 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
  • 632 replies
  • November 6, 2024

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings