Contact Information
- Email: ctoohey@dominoguru.com
- BleedYelow.com: Chris Toohey
- Skype: ChrisToohey
- Gizmo: ChrisToohey
- Yahoo!: ChrsToohey
- Google: ChrsToohey
- AIM: ChrisToohey
- Twitter: ChrisToohey
- Facebook: ChrisToohey
My Twitter Updates
Publishings
Remove my name from the Domino Directory!! 02/05/2008Lotus Notes Quick and Dirty Mail Application Document Importing 01/24/2008
Methods and Strategies Addressing Domino Web-based @DBLookup limitations with Rich-Text and Context Profiles 12/16/2007
Domino Web Development Dynarch Calendar - Date Blockers 01/25/2007
Integrated Solutions Domino Flex Fields 11/03/2006
Methods and Strategies Publishings Archive
Examples & Downloads
Lotus Notes Client Wizard - Components Example Database 04/11/2008Lotus Notes Updated: Quick and Dirty Mail Application Document Importing Example Database 01/29/2008
Examples and Downloads Quick and Dirty Mail Application Document Importing Example Database 01/27/2008
Lotus Notes Excel Export Example Database 08/12/2007
Integrated Solutions Domino Flex Fields (Example) 11/17/2006
Methods and Strategies E & D Archive
Resources
Alan Lepofsky's Notes Tips [ Community ] Chris' The Business Controls Caddy [ Community ] Petr Stanicek [pixy] [ CSS ] JoeLitton.net [ Community ] Alex Hernandez's Weblog [ Community ] Resources ArchiveQuicktip: Web DBLookup API
03/03/2008 03:50:49 PM | Chris Toohey | Bethlehem, PA
This is quick-and-dirty, and something that I just put together for a friend of mine who's working on an ever-expanding (scope, that is...) project. It's simple and gets the job done, but can offer both an insight into more advanced architectures as well as a near-limitless application.
Let's take a look at the @DBLookup Function in all it's glory:
@DbLookup( class : cache ; server : database ; view ; key ; fieldName ; keywords )
We'll go with the cookbook method:
Ingredients
- 1 Form Design Element
- 1 Navigator Design Element
Long list - I know.
So, we'll start by creating a blank Navigator design element named "dblookup". Now, create a Form design element called "$$NavigatorTemplate for dblookup", setting the Content Type to "text/plain", and adding the following fields:
- SaveOptions
- Set to "0", since I don't want this to ever generate content - just render it!
- Body
- Which will be a Computed Rich Text field - see Formula below...
The Body Formula:
@DbLookup( @URLQueryString("class") : @URLQueryString("cache") ; @URLQueryString("server") : @URLQueryString("database") ; @URLQueryString("view") ; @URLQueryString("key") ; @URLQueryString("fieldName") ; @URLQueryString("keywords") )
Disgusting isn't it?!
It's usage:
db.nsf/dblookup?open&cache=NoCache&view=someviewname&key=somekeyvalue&fieldName=returnfieldName&keywords=%5BFAILSILENT%5D
This, as you can see, will do a "NoCache" DBLookup in the current database against the someviewname View for somekeyvalue, returning the value from the NotesItem returnfieldName, and returning "" (blank) when the lookup fails.
The reason that I'm using Plain Text as the Content Type is to allow for usage with AJAX functions, and the Rich Text is used to allow bigger lookups. Need it to do something more, expand away!
Chris Toohey | Domino Guru



Comments
03/04/2008 04:07:58 AM
Why go to the trouble of the navigator & $$navTemplate when you can do it with just a form called dblookup? One less element to worry about!
http://quintessens.wordpress.com
03/04/2008 04:44:16 AM
I see the sense of using a navigator in stead of a form for a form is for me something you present to the end user or something you use for creating documents on the background.
Great code!
dowork.com
3/9/2008 2:58:35 PM