Expand my Community achievements bar.

remove all instances in a repeatable subform

Avatar

Level 3

okay trying a different approach. How would I delete all instances in a repeatable subform that has independent delete buttons for each line. I think that you refer to all instances with the [*]. But that must not be right because I keep getting an error when trying to put in into a line of code. Can anyone tell me what the best way would be. I can get it to delete one instance by making the raw value 0. thanks

1 Reply

Avatar

Level 10

Hi,

If you look at the script in the reset button here: https://acrobat.com/#d=RZ1lzX23*u7L4N9rtWCYPQ

You will see that it has a 'while' loop that keeps deleting instances until it gets down to the minimum of two.

while (flowedSubform.Table1._Row1.count > 2)

{

     flowedSubform.Table1._Row1.removeInstance(1);

}

A similar approach would work for repeating subforms.

Good luck,

Niall

PS: Note the underscore in front of the repeatable object "_Row1" is shorthand for "instanceManager".