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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Reference specific field in a repeating subform

scottb6639504
Level 2
Level 2

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!

1 Accepted Solution
_Bruce_Robertson
Correct answer by
Level 10
Level 10

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

View solution in original post

3 Replies
_Bruce_Robertson
Correct answer by
Level 10
Level 10

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

View solution in original post

scottb6639504
Level 2
Level 2

So currently the code is sitting in the OnExit event of a dropdown list, which is sitting within Repeatedform2

_Bruce_Robertson
Level 10
Level 10

You can generate a relative reference to a form object by;

1. making sure the code editor has focus

2. hold the ctrl key down

3. Click the form object in the design view