Domino Upgrade

Search

About Me

I am the "Lotus Technology & Productivity Advisor" for IBM Asia Pacific. I'm based in Singapore.
Reach out to me via:
Follow notessensei on Twitter
Yahoo IM
Skype
Sametime
IBM

Ads by Google

Twitter

Languages

Other languages on request.

Visitors

« What type is that blog? | Main| Notes Application Statistics »

Avoid Keyword Lookups in Read Mode

QuickImage Keyword fields (known to the younger audience as: Radio buttons, checkboxes, combobox, dropdowns etc.) very often are populated by @Formulas. @DBColumn, @DBLookup and @GetProfileField are equally popluar. For best performance you should use @GetProfileField (if that is possible in your application context). Another way to speed things up: prevent the formulas from executing in Read Mode. If for example a formula to populate the options looks like this:
tmp := @DBLookup("Notes":"NoCache";"";"(LookupProjectsBySponsor)";@UserName;2);
@if(@IsError(tmp);"You don't sponsor projects"; tmp)
change it to
@if(!@IsDocBeingEdited;@Return(@ThisValue);"");
tmp := @DBLookup("Notes":"NoCache";"";"(LookupProjectsBySponsor)";@UserName;2);
@if(@IsError(tmp);"You don't sponsor projects"; tmp)
 
You can refine that and not populate keywords you don't intend to change (based on a status), you would update the first condition then.

Comments

Gravatar Image1 - The "Code Helper" tab on a SuperNTF Keyword or Name List configuration document utilizes a variation of this technique that Andre Guirard had posted about a while back. I'll take a closer look but I think the @ThisValue bit might be an improvement over that approach.

In any case, one "gotcha" with this technique is when a keyword field uses aliases. In those cases, the lookup is necessary to ensure the "user-friendly" non-alias value displays in read mode.

Gravatar Image2 - One more addition to this method. If the number of lookup fields are more, we can compute @isdocbeingedited in a separate field (Computed For Display Field) and then use

@if(IsDocBeingEdited="0";@Return(@ThisValue);"");
tmp := @DBLookup("Notes":"NoCache";"";"(LookupProjectsBySponsor)";@UserName;2);
@if(@IsError(tmp);"You don't sponsor projects"; tmp)

This avoid @isdocbeingedited formula getting calculated every time.

Post A Comment

Please note: Comments without a valid and working eMail address will be removed. This is my site, so I decide what stays here and what goes.

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)

Disclaimer

This site is in no way affiliated, endorsed, sanctioned, supported, nor enlightened by Lotus Software nor IBM Corporation. I may be an employee, but the opinions, theories, facts, etc. presented here are my own and are in now way given in any official capacity. In short, these are my words and this is my site, not IBM's - and don't even begin to think otherwise. (Disclaimer shamelessly plugged from Rocky Oliver)

© 2003 - 2010 Stephan H. Wissel - all rights reserved as listed here: Creative Commons License
Unless otherwise labeled by its originating author, the content found on this site is made available under the terms of an Attribution/NonCommercial/ShareAlike Creative Commons License, with the exception that no rights are granted -- since they are not mine to grant -- in any logo, graphic design, trademarks or trade names of any type.

Get Firefox Use OpenDNS