Reference specific field in a repeating subform

scottb6639504

27-08-2019

Hi Everyone,

I have the following piece of code sitting within a subform which is dynamically repeated:

var TreatDate = FormName.Subform1.Subform2.RepeatedForm1.Subform3.Subform4.RepeatedForm2.Subform5.Subform6.textfield.rawValue

RepeatedForm1 can have multiple RepeatedForm2's, and there can be multiple of the RepeatedForm1's within the form Ie like the structure below:

Repeatedform1 (instance1)

     RepeatedForm2 (instance1)

     RepeatedForm2(instance2)

     RepeatedForm2(instance3)

     RepeatedForm2(instance4)

Repeatedform1(Instance2)

     RepeatedForm2(instance1)

     RepeatedForm2(instance2)

     RepeatedForm2(instance3)

     RepeatedForm2(instance4)

     RepeatedForm2(instance5)

     RepeatedForm2(instance6)

     RepeatedForm2(instance7)

My question is: how can i make use of the xfa.resolveNode() statement (or a more correct statement!) to make sure i get the value of the correct instance of Repeatedform1 & Repeatedform2 so i can correctly store the value of the textfield into the local variable?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

_Bruce_Robertson

MVP

27-08-2019

You should make a relative reference to the field, so probably something like

var TreatDate = RepeatedForm2.Subform5.Subform 6.textfield.rawValue

But it depends were the code is

Answers (2)

Answers (2)