Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line Number in Repeating Panel

Status
Not open for further replies.

andysimm

Technical User
Jun 12, 2002
12
GB
I have a need to generate a line number in a repaeting panel.
The line number must be calculated for each of the "master" records.
I can calculate the number of items in the panel (SCount function) but cannot get in effect a running total.
Any help would be appreciated (But not lotus script I am still in the dark ages as far as script is concerned :( - any good ways to learn ??)
TIA
Andy
 
Create a calc field, named LineCount say, to SCount a non-blank repeating panel field and set its summary option to "All records in xxx" where xxx is the repeating panel table.

Then define a default creation formula for the line number field:

LineCount + 1

However, in a multi-user system, where more than one operator may be adding lines to the same main record, the above method could generate duplicate numbers. Each operator works with their own data set and doesn't see other operators' updates until the data is refreshed.

In a multi-user system, the only safe way is to keep a next line number field in the main record and use script to get/increment it. This way, if another user has the record locked, an error will be raised when the increment is committed which can be trapped and handled.

There's an example at in the Approach - FAQs - Tips & Techniques folder, "Maintain auto-serial numbers when creating records with a ResultSet object". You need to register (free) and login to access the folder.

Paul Bent
Northwind IT Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top