I am having problem using addInstance in my form, I checked all the forums and tried lot many things still the issue is same.
I have a form with 2 pages and for second page there should be an Add button whenever I click the Add it should add the page 2 contents.
I am saving my form as dynamic also I set the repat subform max and min values.
But still I get the error
GeneralError: Operation failed.
XFAObject.addInstance:1:XFA:form1[0]:P2[0]:Add[0]:click
The element [max] has violated its allowable number of occurrences.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Here is the form back to you: https://acrobat.com/#d=G3vkuNS4xdlbTH7xVNiSEg.
You were referencing two subforms down into P2, whereas P2 was the repeating object. I changed the script to reference the repeating object:
P2.instanceManager.addInstance(true);
You could also use the shorthand for instanceManager (_):
_P2.addInstance(true);
You had set up P2 as flowed, so that new instance appear straight after the previous instance. So I have set up a new P3 which is positioned and new instances of this page appear on a new page. Have a look at the pagination settings.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
If you select page2 and go to the Object > Binding palette, you will see a checkbox for the repeating the object. Tick this and as an option you can tick the Min of 1 (and/or a Max, and/or an initial count).
This will then allow the add button to create a new instance of page2. Please note that the new instance will be the default appearance and values of page2.
Hope that helps,
Niall
Views
Replies
Total Likes
Hello Niall,
I tried that option but still I get the same error, Can I get a sample or do you want me send my form to you (it is just a simple form I am trying).
Views
Replies
Total Likes
Hi,
If you upload your form (or sample) to Acrobat.com, publish it and then post the published URL here I will check it out when I can.
Niall
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi,
Here is the form back to you: https://acrobat.com/#d=G3vkuNS4xdlbTH7xVNiSEg.
You were referencing two subforms down into P2, whereas P2 was the repeating object. I changed the script to reference the repeating object:
P2.instanceManager.addInstance(true);
You could also use the shorthand for instanceManager (_):
_P2.addInstance(true);
You had set up P2 as flowed, so that new instance appear straight after the previous instance. So I have set up a new P3 which is positioned and new instances of this page appear on a new page. Have a look at the pagination settings.
Hope that helps,
Niall
Views
Replies
Total Likes
Thanks Niall, It Worked.
Views
Replies
Total Likes