Items that are scripted to be removed with this script reappear on the form after it is saved and re-opened.
Sample text (I am trying to remove a table):
_Subform_WS0941_Table.instanceManager.removeInstance(0);
Is there a master form setting that I need to setup. I looked at the Purchase Order sample provided with the software and it works just how I want it to work but cannot figure out how it is different form the form I am attempting to create.
Any guidance would be grstly appreciated.
Thanks
Views
Replies
Total Likes
Hi,
A couple of things:
I would not use an underscore in the object's name, as "_" is used as shorthand for instanceManager.
What is the name of the repeating object? Is it "_Subform_WS0941_Table"?
The parameter in the removeInstance is the instance that you want to remove, based on a zero numbering system. So using "0" will always remove the first instance. This may not be what you want.
Lastly, if you go to the File > Form Properties > Defaults tab and make sure that the preserve script changes is ticked for Automatic.
Hope that helps,
Niall
Views
Replies
Total Likes
Nial,
Thanks for your response. See my comments and screen shots below:
Steve
Screen shots:
Beginning:
After
Hi Niall,
A couple of things:
I would not use an underscore in the object's name, as "_" is used as shorthand for instanceManager.
Removed underscores & rewrote the script two different ways:
· SubformWS0941Table.instanceManager.removeInstance(this.parent.index);
· SubformWS0941Table.instanceManager.removeInstance(0);
What is the name of the repeating object? Is it "_Subform_WS0941_Table"?
The parameter in the removeInstance is the instance that you want to remove, based on a zero numbering system. So using "0" will always remove the first instance. This may not be what you want.
Lastly, if you go to the File > Form Properties > Defaults tab and make sure that the preserve script changes is ticked for Automatic.
Tried your suggestions with the same result.
Views
Replies
Total Likes
Hi Steve,
Can you select the repeated object and go to the Object > Binding tab. Check that the min count and initial count boxes are NOT ticked. I suspect that one of these is ticked and therefore once the form is reopened, it is rendering an instance.
Does that help?
Niall
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies