I am using "this.parent" expression in buttons for a few functions like clearing text in text fields. but what if I want the same button to clear text in a text field on a different page and/or subform. I know it's not "this.parent" because the text field isn't in the same page or subform as the clear button. what is the alternate script?
Below is the button functions I am using where the button is in the same subform. How do I extend the particular function of a button to perform the same action to fields in another page and/or subform?
Example 1: Delete Instance button
this.resolveNode("Subform1").instanceManager.removeInstance(this.parent.index);
xfa.form.recalculate(1);
Example 2: Clear field(s) button
var f1 = this.parent.somExpression + ".TextField1" + ",";
var f2 = f1 + this.parent.somExpression + ".TextField2" + ",";
xfa.host.resetData(f2);
xfa.form.recalculate(1);
The trick is to navigate to where you can see the object you are trying to reference, click in the Script Editor and then press CTRL or CTRL-SHIFT and click on the object you want - the mouse cursor should change to a "V" when you are over a valid target.