Home > Domino Tips > Developer > Formula > Numbering dynamic rows
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

FORMULA

Numbering dynamic rows


John Robertson
02.07.2005
Rating: -4.20- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


View member feedback to this tip.

This tip provides a quick way to dynamically number rows. The code helps provide a quick visual item listing for end users when dealing with multi-item lists.

The code will generate a list from 01-99. To increase the row numbering to 999 simply add another permutation and adjust the limit like this:

tNumberList := @Subset
(@Subset(tNumberSet *+ tNumberSet *
+ tNumberSet; -999); 
tListElements);

Keep in mind that there is a Lotus Notes field limitation that could limit the overall formula computation. If a list grows beyond the Notes limitation, you will see this error: "Paragraph or field cannot be larger than 64K bytes."

REM "This is the field which needs to 
be enumerated."; 
tFieldList := ListTX; 
REM "Build number array"; 
tListElements := @Elements(tFieldList); 
tNumberSet := "0":"1":"2":"3":"4":"5":"6":"7":"8":"9"; 
tNumberList := @Subset(@Subset(tNumberSet *
+ tNumberSet; - 99); 
tListElements); 
tRowNums := @If(tListElements < 1; ""; tNumberList); 
REM "Concatenate number array with actual text list."; 
tRowNums + ": " + tFieldList

MEMBER FEEDBACK TO THIS TIP

The value for variable tListElements is assigned by the formula

@Elements(tFieldList)
 

And because of this, tListElements will NEVER be less than 1, so it is pointless to check for this case. In this case, instead of the last few lines of the code being:

tRowNums := @If(tListElements > 1; ""; tNumberList);
REM "Concatenate number array with actual text list.";
tRowNums + ": " + tFieldList

I suggest that the code be:

tRowNums := @If(@trim(tFieldList) = ""; ""; tNumberList + ": ");
REM "Concatenate number array with actual text list.";
tRowNums + tFieldList
 

This will prevent the return of a ":" when tFieldList is blank

—Cesar M.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member John Robertson. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Formula
Formula language button manages Deny Access list searches
Retrieve Lotus Notes names from a nested group using @DBLookup
Create a computed Lotus Notes field to list Personal Address Book names
Show multiple Lotus Notes document fields in a single view column
How to send a document as a link in a Lotus Notes email
How to generate formatted sequence numbers with Formula language
A simpler pagination view for Lotus Notes documents on the Web
A bevy of Notes/Domino development tips
Easily implement attachment fields in a Web form using Formula
Programmatically create a shortcut for Lotus Notes

Lotus Notes Domino Formula Language
Stop response documents from showing in a Lotus Notes form
Formula language button manages Deny Access list searches
Add a program doc to compact Lotus Notes databases automatically
Top 10 Lotus Notes Domino programming and development tips of 2007
Retrieve Lotus Notes names from a nested group using @DBLookup
Top 5 @DBLookup tips
Create a computed Lotus Notes field to list Personal Address Book names
Show multiple Lotus Notes document fields in a single view column
Lotus Formula language coding primer
How to send a document as a link in a Lotus Notes email

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts