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
SOLVED

Adaptive form calculate expression for multiple instances

Avatar

Level 1

How do you call each instance and get the numeric value to calculate a total value? I'm stuck at identifying the syntax for each instance's value - here's the script for the calculated field:

 

var f = guideRootPanel.tblAgencies.Agency.instanceManager.instanceCount;
var total = 0;
for (var i=0; i < f; i++) {
total = total + guideRootPanel.tblAgencies.Agency(i).ContractID.value;
}
this.value = total;

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 1

Our team found the answer in case this helps someone else:

 

total = total + Agency.instanceManager.instances[i].ContractID.value;

View solution in original post

2 Replies

Avatar

Correct answer by
Level 1

Our team found the answer in case this helps someone else:

 

total = total + Agency.instanceManager.instances[i].ContractID.value;