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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to remove all instance in a repeatable subform (bis)

phil74801
Level 3
Level 3

Hi Niall,

A few years ago, you helped a user who asked "How to remove all instance in a repeatable subform". Please could you do again with approximately the same problem ?

In a click event, I have the script "_CarteEN.addInstance();". Well ! Many cards appear. To protect them, I put above a mask (it's a button with a background Fill). Now, how can I do to remove all masks with only one click using the resetdata or anything else...

I try this but it doesn't work.

while (flowedSubform.CarteEN._CacheCV.count > 2)
{
     flowedSubform.CarteEN._CacheCV.removeInstance(1);
}

Many thanks for your help !

0 Replies
_Nith_
Level 10
Level 10

Drop me an email with the sample PDF you tried. I don't see anything wrong in this code.

or the best way is to add try..catch block and see the error thrown.

Nith

_Nith_
Level 10
Level 10

There is no subform named "flowedSubform"

The "CacheCV" is not a container object (subform). so you can't access the instanceManger of this object.

the below lines should work

while(_CarteEN.count >1)

{

     _CarteEN.removeInstance(1);

}

Nith

gretchenhs42
Level 3
Level 3

All I do is in the click

 

CP1218_SubformSet.instanceManager.removeInstance(true)

CP1218_SubformSet - being the subform name.

phil74801
Level 3
Level 3

Thanks Nith,

I have corrected the file but it doesn't work. I don't know what is wrong.  I downloaded it.

https://workspaces.acrobat.com/?d=Ut7ZF7iLin7sbL3tAA791Q

Thanks by advance