Solved

recalculate grid values (Totals)

  • 1 September 2021
  • 4 replies
  • 262 views

Userlevel 2

Hi good night.

 

I have a problem. I need to re-calculate the values ​​of the “Accumulated amount” column every time I make a change in any column of the grid (specially the colum TotalAmount). re-calculated de values and show in the grid.
The business rule for the “Accumulated total amount” column is as follows:sum current row + previous row. (in the first row the previous row is zero).
the result that I would expect
I used this code in the row_updated event but it doesn't work as I expect. (This code is in the Row_Updated Event
//In this code for each interaction 1 is added so if I have a grid with 4 rows in AccumulatedAmount //it should look like: 1,2,3,4 but it doesn't work

int cont = 0;

foreach (CEEstimateAddOn soLine in this.viewCEEstimateAddOn.Select())
{
cont+=1;
soLine.AccumulatedAmount = cont;
}
with the code above only the “edited/active” row show the result. 
and not in all rows as I need
Could you please help me.
icon

Best answer by Naveen Boga 1 September 2021, 08:00

View original

4 replies

Userlevel 7
Badge +17

Hi @eddiedaco  

Accumulated total amount = (Current Row of Total Amount + Previous Row of Accumulated total amount)

For this requirement, your grid should have the soring order like (LineNbr will be like 1,2,3..etc for each record). Based on this LineNbr you can fetch the proper values for “Current Row of Total Amount” and “Previous Row of Accumulated total amount” and assign it to Accumulated total amount.

Userlevel 4
Badge

HI Naveen,

I’m new to acumatica. Can you please share the code for this Accumulated total amount calculation.

Please do the needful.

Thank you..

Regards,

Ramya Krishna

Userlevel 7
Badge +17

Hi @ramya15  Can you please let me know what is your requirement and it will better that if you create a new question so that others can read provide you the solution.

Userlevel 4
Badge

Hi @Naveen B ,

I have a requirement to calculate the “Cumulative completion” based  for each task of the project based on the previous “Completion” entry. 

 

Could you please guide me on this.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved