You are viewing limited content. For full access, please sign in.

Question

Question

Does SUM calculations only trigger on clicking the add button.

asked on December 9, 2015 Show version history

Hi there

 

Question regarding the Forms 10 calculation: 

I am adding up the total of a sub total field in a table.

This works by adding the following in the advanced tab in the Total field - "=SUM(Expected_Expenses.Total_Cost_1)"

The calculation only triggers when I click on the add button.
This complicated later processing if a blank field is added.

Removing rows also does not trigger the calculation therefore you need to again click on the add button to trigger the calculation.

 

I have uploaded a small clip.

1 0

Replies

replied on January 5, 2016

The issue of field calculations updated correctly when deleting a row in a table is addressed in Laserfiche Forms 10 Update 1

1 0
replied on September 19, 2018

I am experiencing the same thing as the original poster in Forms 10.3.1.635 where the calculation is only happening once the Add button is clicked in the table.

1 0
replied on December 9, 2015

Hi Roy,

For the issue that calculation is not updated when the Total Cost column is filled in a new row, we can't reproduce it. Can you share with us how you filled the Total Cost column in table? Did you use custom JavaScript? Or give us the xml for your process so we can see into it.

For the issue that calculation is not updated when delete a row, it is confirmed to be a bug in Forms 10. Can you open a support case about this issue? We can provide a temporary fix.

Sorry for the inconvenience.

0 0
replied on December 16, 2015

Hey Rui,

Working on a rebuilding clients process in Forms 10, I have managed to reproduce the same issue Roy is/was having.

Table on Form:

 

I do use some custom scripting to calculate a subtotal in the 'Amount' column of the table. It simply takes 'Quantity' and multiplies it by the 'Price' and plugs in the result to 'Amount'

Script:

While it does function by populating the 'Amount' column, the built in function tool on the advanced tab does not populate the 'Total' currency field below the table.

Advanced Tab function:

Form with 'Amount' calculated, but no 'Total' calculated.

Only when I click 'Add' does the 'Total' field calculate. Plus, after I do add a row, if I was to delete the row, it does not update the 'Total' field either.

 

So anyways, with all of that explained and shown, is there a fix to this issue? For updating the total automatically without the need to add a new row, and to update when deleting rows? Or do I have to revert back to the complete custom scripting I was using before (which we are trying to move away from and use more 'out-of-the-box' features)? Plus, will the ability to do across row calculations be added and integrated with column based calculations (for example we need the ability to use =PROD() across a row, and use it with =SUM() down a column)?

 

 

0 0
replied on December 16, 2015 Show version history

Hi Doug,

For the issue that calculation is not updated when add a row, you need to trigger the change event on the total field after you give it value in your custom script.

Update your script like this:

      $(this).find('.total input').val(subtotal);
      $(this).find('.total input').change(); //Add this line
      $(this).find('.total input').attr("readonly", true);

As for the issue that calculation is not updated when delete a row, can you open a support case? We can provide a temporary fix.

And we will add functions to support cross row calculations in next release.

2 0
replied on December 18, 2015

Hi again Rui,

Okay, so I placed the one code snippet in there and that worked, thank you very much! I will start a case today in order to resolve the other issue. Again, thank you very much!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.