I created a form with a button to remove the current action item via script. Although I have reviewed this script repeatedly, and used the Add Action for the button I still cannot get the button to remove the Current instance. The button always removes the first instance. Does anyone have any answers with this problem? Is my hierarchy wrong for this action?
Solved! Go to Solution.
Views
Replies
Total Likes
What code is on the delete button now?
It's unclear what you're trying to delete, is it the CorrAction subform?
If it's the "CorrAction" subform you would need:
_CorrAction.removeInstance(this.parent.parent.index);
As CorrAction is 2 levels (parents) above the delete button.
If it is "Action" you are trying to delete then you would need:
_Action.removeInstance(this.parent.parent.parent.index);
Views
Replies
Total Likes
What code is on the delete button now?
It's unclear what you're trying to delete, is it the CorrAction subform?
If it's the "CorrAction" subform you would need:
_CorrAction.removeInstance(this.parent.parent.index);
As CorrAction is 2 levels (parents) above the delete button.
If it is "Action" you are trying to delete then you would need:
_Action.removeInstance(this.parent.parent.parent.index);
Views
Replies
Total Likes
this.resolveNode('Fourteen._Action').removeInstance(this.parent.index);
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
the subform I am trying to delete is "Action". "CorrAction" is a subform of "Action". The "Action"subform adds the delete box to the contents of "CorrAction". If fixed it with your with one more parent.
this.resolveNode('Fourteen._Action').removeInstance(this.parent.parent.parent.index);
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
Thanks again Jono!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies