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

Repeating Subform reference (FormCalc)

Avatar

Level 1

How do you concisely reference a repeating subform? I need to retrieve a value from a field in repeating subform within a repeating subform without explicitly referencing each field. Please provide a FormCalc sample if possible. Fyi, I have read a million for/if loop and resolveNode threads but still don't get it. The abreviated code is below but goes on forever... Thank you in advance for being so smart and helpful.

if(PartNo==110) then

     Item1=sfQtMaster.sfQuote[0].sfDetail[0].sfPrice.Item1     //Quote 1, Row 1

     Item2=sfQtMaster.sfQuote[0].sfDetail[1].sfPrice.Item2     //Quote 1, Row 2

     Item3=sfQtMaster.sfQuote[0].sfDetail[2].sfPrice.Item3     //Quote 1, Row 3

elseif(PartNo==111) then

     Item1=sfQtMaster.sfQuote[1].sfDetail[0].sfPrice.Item1     //Quote 2, Row 1

     Item2=sfQtMaster.sfQuote[1].sfDetail[1].sfPrice.Item2     //Quote 2, Row 2

     Item3=sfQtMaster.sfQuote[1].sfDetail[2].sfPrice.Item3     //Quote 2, Row 3

endif

Thanks

2 Replies

Avatar

Level 7

I would make a variable called 'count' and then use a loop to scroll through all the instances referencing the index of each instance as count.

Avatar

Level 1

Sorry to be greedy but can you provide an example or direct me to one?