Home > Domino Tips > Developer > Formula > Making your lookups more readable and maintainable
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

FORMULA

Making your lookups more readable and maintainable


Erik Rydberg
04.25.2006
Rating: -4.61- (out of 5) Hall of fame tip of the month winner


Lotus Notes and Domino tips, tutorials and how-to articles
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


VIEW MEMBER FEEDACK TO THIS TIP

@DBLookups are powerful and, usually, a fast way to find data within an application. When I first started developing Notes/Domino applications I used lookups everywhere, even if I was getting data from the same document. This is bad for performance.

After a while, I understood that a better way to do this was to do just one lookup, get a summarized value from a document, and then parse out various bits of information to different fields on the form.

To create a summarized string, you usually put some kind of separator between the values in the column formula, or even a hidden field on the form that does the computing of the summarized values -- for even better performance, since the view index will be faster.

For example, a normal string of several values might be: erik~rydberg~sweden~2. You can parse out any value with @left/@right or @word.

There are at least two problems with the above string -- both concern maintaining applications. First, it is hard to figure out what the values are (what does 2 mean in the above example?) Second, it is hard to change the order of the string, remove something that isn't needed anymore or add a value. You can't be sure that nothing is going to break, even if you just add a value at the end of the string – -- especially if you didn't build the application or it was too long ago to remember all the details.

I started to use the following syntax instead:

<firstname>erik</firstname>
<lastname>rydberg</lastname>
<kids>2</kids>.

I also changed the way I extract values from the string. Now I use @Middle instead. To get the number of kids: @Middle(string;"<kids>";"</kids>").

I think it is safe to say that the string is more readable even for someone who didn't develop the application in the first place. Also, it is a lot easier to change the string since it is not as order-sensitive as the old one was.


MEMBER FEEDBACK TO THIS TIP

This is a very good tip. It's very clear and easy to use, thanks!
—Linda T.


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

This tip was submitted to the SearchDomino.com tip library by member Erik Rydberg. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

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.




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


RELATED CONTENT
Formula
Using Formula language code to sort Lotus Notes messages by subject
How to create dynamic JavaScript in Notes Domino without formulas
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

Lotus Notes Domino Formula Language
Top 10 Formula language tips
Using Formula language code to sort Lotus Notes messages by subject
How to create dynamic JavaScript in Notes Domino without formulas
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

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.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge 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