Avatar

Level 2

In Table1, Row1 is a repeatable row with an autonumber field and add/delete buttons.  When you click "add" there is another row added to Table1 AND Table2, with the same autonumber.  When you click "delete" I need it to delete the same relative row in both tables.

So if the delete button for Table1.Row1[2] is clicked, I want it to delete Table1.Row1[2] and Table2.Row1[2].  Right now it will delete Table1.Row1[2] and Table2.Row1[0].

I know it needs to loop and count, but I'm not sure how to incorporate that into the delete action for two separate tables.

Here's my code so far:

this.resolveNode('Table1._Row1').removeInstance(this.parent.parent.index);

this.resolveNode('Table2._Row1').removeInstance(this.parent.index);

if (xfa.host.version < :smiling_face_with_sunglasses: {

          xfa.form.recalculate(1);

}