Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

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

Avatar

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 !

5 Replies

Avatar

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

Avatar

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

Avatar

Level 3

All I do is in the click

 

CP1218_SubformSet.instanceManager.removeInstance(true)

CP1218_SubformSet - being the subform name.

Avatar

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