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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Calling a Script Object after remove instance index[0]


Level 5

     I have created a LiveCycle document that has a repeatable subform as url linked below. The form will not let me call a Script Object after removing an instance at index[0]. Regardless of the number of instances remaining. I use a script object to show and hide buttons. Adding an instance is not a problem. What to do?

Script on Delete Subform Button (Error):



if ( < 😎 {


//deleteing a [0] index seems to create a problem for executing the function in this Script Object


3 Replies


Level 10

Hi there,

when you work around with instances you should always put ur removeInstance at the end of your code...

Because when you remove an instance the somExpression of the object you are in, doesnt exist anymore, cuz u change the index of the object that fires the event

unless that u remove an instance that is higher than the instance you are actually in.

hope this help


Level 5

Magus069 thanks for your reply. But I don't understand what you mean by adding the "ur removeInstance" to the end of the code. Could you expound or point me to a url that explains this idea?


Level 10


What seems to happen when you remove a form object that has code that is currently executing is that it can't find the next line.  You might want to put all your code in the script object.

so in the click event you have;


Then your script object will start

function fxremove(button) {


    if ( < 8) {



    console.println("The SOremove.fxremove fired");