Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Autosum totals for amounts in multiple instances of table?


Level 2

I'm using LiveCycle ES2 to create an expense claim form. I have no trouble calculating the sum of all values in a column in a table with repeatable rows. However, this form is more complex. As you'll see, each item (expense) is a table. Clicking the button adds a new instance of the table. No problem with the calculation for GST, either.


Where it gets tricky is trying to dynamically calculate the grand totals for all expenses incurred and for all GST. This is in a different table, as you can see here.


And here's a grab of the object hierarchy that illustrates just how I built this.


Is this too complex, or is there a way to dynamically calculate the grand totals, regardless of how many instances of ExpenseDetails there may be?

0 Replies


Level 10

Nothing is too complex to calculate, using FormCalc should help you big time!

Using formCal for every instance should look something like this :


Row1[*] specify every instance of the object


Level 2

Hello, Magus069, and thank you for the reply. As you can see, however, it doesn't achieve the desired result.



Level 2

Unless I misunderstood your post, I put the line of code provided in the GST cell of the Labels row in the Totals table.


This illustrates the table, and that it's configured to be repeatable.


As indicated earlier, the Add/Delete buttons add/remove an instance of the entire table.


Level 10

I am not sure if this could fix it... but you might want to name your Subform that contains ExpenseDetails other than the table's name itself...

Code your AmtExclGST total too in the same way of your GST to see if there's any difference


Level 10

Can you make another screenshot of the result, and use different values


Level 10

Oh!!! okay geez, you create instance of your table with you parent Subform or with your table?

When you click Add Row, you are using instanceManager.addInstance(1) or insertInstance(x), when you write your calculate code line you must input this [*] on the object that you add instances too


Level 2

If Add row is clicked, add a new instance of ExpenseDetails table. Conversely, if Delete row is clicked, remove current instance of ExpenseDetails table.

These actions were built using the Action Builder, not code.

Can you let me know where the wildcard, [*], goes?


Level 10

can you show me the code written in add row click?

If I understand, it should be something like so:


but seeing you add row code should help, even if the action builder did it for you, there's should be some code in the click event


Level 2

Note that I've renamed the subform:


The code for the AmtExclGST is:


And the code for GST is:


This worked!


Thank you very, very, very much!

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now