Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

sum fields of different instances of subform

Avatar

Level 2

I have a field in repeating subform I want to add with the previous fields in the previous instances. How could I accomplish that?

Thanks

3 Replies

Avatar

Level 9

Hi,

In the calculate event of the Total field you can put this script.

Sum(form1.page1.Table1.Row1[*].Cell1) in FormCalc. If you want a cumulative addition I mean Ro3Value = Row1 value + Row 2 value. i.e every new instance value will be automatically added to the previous instance value. You can also use the same script . Make the field as hidden. Then in the exit event of the Row's field populate the same value from the hidden Total field.

Thanks,

Bibhu.

Avatar

Level 2

Hi,there's no table.Just subforms.

Avatar

Level 9

Ok. You can use the same script with little bit of changes. Sum(form1.page1.subform1[*].TextField1). And as I have mentioned earlier you have count the no. of instance and loop through those values for a cumulative value.

Thanks,

Bibhu.