I'm creating a form which will allow users to create a list of steps to perform a Job. I want to create the form so that they can insert a step between two other steps and delete any step they choose. I'm not familiar enough with the programming and when I write the script to add an instance, all it does is add it to the bottom of all my subforms rather than between my subforms. Also, I am limited to using livecycle designer 7.0.
I've put a link to the document below:
Views
Replies
Total Likes
You have to add the subform (it will be at the bottom) then you need to move it to the desired location. I created a sample that shows this. Add a few rows then hit the Add Special Item button.
Paul
Views
Replies
Total Likes
Paul,
Thanks for the reply. Is there something wrong with the file? I can not get it to open. It says "invalidated enumerated value: Index change the fault occured on line 21" when I try to open the file.
Thanks!
-Brian
Views
Replies
Total Likes
Opens fine for me ......I see that you are on Designer 7 that might be the issue. Here is the code that I used to add then move the subform:
// Invoke the Instance Manager to add one instance of the detail subform.
details._detail.addInstance(1);
//Get the total number of detail subforms
count = details._detail.count;
//Ask the user where they want to put the subform
loc = app.response("Please enter the row number where you want the new row to appear:");
//Move the subform to the desired location (note that instances are 0 based and the count is 1 based)
details._detail.moveInstance(count - 1, loc - 1);
//Invoke the recalculate method to include the field values from the added row in calculations.
xfa.form.recalculate(1);
Hope that helps
Paul
Views
Replies
Total Likes
Views
Likes
Replies