Expand my Community achievements bar.

Duplicate + AddInstance

Avatar

Former Community Member
I have a form in LiveCycle that has an add button to add a new instance and a delete button for each instance added so that a user can delete a selected instance. When the Add button is clicked, a new blank instance is added with all blank fields. What I'd like to be able to do is add another button to each instance, similar to the delete button, that when clicked will add a new instance that populates all blank fields with whatever has been entered into those fields. Thus it would essentially create a duplicate of the selected instance, rather than a set of new blank fields. Seems simple enough, but I'm having a hard time getting it to work. Any ideas? Thanks for your help.
1 Reply

Avatar

Former Community Member
Use two subforms.

On the inner subform, place all the fields that you want to duplicate.

on the Outer subform, place the "Add Instance-2" (for Example) button.



Add another button "Add Instance -1"(for example) outside of these two subforms.

So when you click on use "Add Instance -1", use the outer subform name to add a new instance.(Internnally it will duplicate the inner subform with the fields and "Add Instance-2" button.



In the click event code of the "Add Instance-2" button, use the inner Subform name to add a new instance.



Always make sure you have the height setting for both the subforms set to "Autofit".



Hope this will help.