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
BedrockMission!

Learn More

View all

Sign in to view all badges

Counting instances?

Avatar

Avatar
Level 1
AKCourtney
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
AKCourtney
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
AKCourtney
Level 1

11-02-2009

I am completely new to lifecycle and I am having difficulty with a form. It is a relatively simple form; however in the section of the form with a table for invoice items I am having some difficulty. The problem is: an expanding table to allow the end user to add a row for additional invoice items and then it calculates a total item and grand total for the invoice.



I would like to have the item number generated automatically 1,2,3,4, ect but right now it starts at 0 (I think that might defeat the purpose of numbering items). I think this is counting the instances? I am not sure =(



Sorry if I did not adhere to the proper forum etiquette, or if I posted in the wrong place. I dont really know the ins and outs of this whole thing and I could really use some help!!



Here is the scripting in the form:(I think I need to change the first one, but how!?!)



// This script displays the instance value of the row in this text field.



// Invoke the Instance Manager to add one instance of the detail subform.



details._detail.addInstance(1);



//Invoke the recalculate method to include the field values from the added row in calculations.



// Invoke the Instance Manager to remove the current instance of the detail subform.

Replies

Avatar

Avatar
Boost 1
Level 2
StefCameron
Level 2

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Boost 1
Affirm 1
View profile

Avatar
Boost 1
Level 2
StefCameron
Level 2

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Boost 1
Affirm 1
View profile
StefCameron
Level 2

11-02-2009

Courtney Wilkins,



For future reference, the proper Adobe Forum to post such questions is the
LiveCycle Designer ES forum.



Have a look at the "Purchase Order -- Dynamic Interactive" sample that ships with Designer. You'll find it in the following folder:



{Designer_install_location}\{version}\EN\Samples\Forms\Purchase Order\Dynamic Interactive\Forms



It's a great example of a dynamic table with various sums.



As for the "item number", I'm assuming you mean the row index. If that's the case, then lets say you have a cell in your repeatable table row named "RowIndex" which is a text field. Also assuming you're running Designer 8.0 or later, you would add the following script to the row's IndexChange event (in JavaScript):



RowIndex.rawValue = (this.index + 1) + ".";



For more info, you could try the following posts and comments on my blog:
Calculate Scripts and
Instance Manager Object Reference.



Stefan

Adobe Systems



More answers at
Stefan Cameron on Forms.