Search DominoPower's 11,320 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
PROGRAMMING POWER
Little known traps about Lotus Notes fields
By Mick Moignard

Fields would seem to be simple things, places to put data items. But like much else in Notes, they're traps for the unwary. They're traps for more experienced developers too, just when you're looking somewhere else.

Computed for Display
The first trap is Computed for Display fields. These are intended to enable you to calculate field values on the fly, using them to display on the screen or to drive underlying functionality, without saving that result to the document on disk. They've often been used, along with some hide-whens, in a mechanism to prevent certain users from editing fields.

"It will all be your fault - even if you'd had nothing to do with it."

The first trap is this: should the document actually contain a field of the same name as a Computed for Display field on the form, the Computed for Display field will display that document field value, rather than the expected calculated value. That one can lead to many hours of frustrated work and not a little swearing when it strikes you. It is most likely to happen when the design of an application has changed, where a field that used to be computed or editable becomes a computed for display, but the underlying data hasn't been changed.

So if you ever change a field from to Computed for Display, it's always worth an agent to skim through the data and delete all fields of that name from the documents.

There's another Computed for Display trap for the unwary, too. If the document isn't open in the UI, the field won't be present, as it's only calculated by the front-end as the document is displayed. While not many people will make that mistake in a background task such as an agent, it does mean that you need to be careful with client-side code.

From a LotusScript perspective, Computed for Display field aren't present until the form PostOpen event - you cannot get to them in the form QueryOpen. Actually, the field becomes "available" once the rendering process passes it. When Notes renders a document and form onto the screen, it processes the fields from top left to bottom right. Computed for Display fields don't exist until the order of processing passes over them - which means that the initialise event of a field cannot see a Computed for Display field that's below it, only those that are above it. Once you get to PostOpen, they're there, in the UI document and in the back-end NotesDocument that's referred to by the NotesUIDocument - but of course they aren't present in any NotesDocument that's opened from the NotesDatabase itself.


1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Use the LotusScript Split function to write simpler code
Home > Tips & Techniques (102 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   A faster way to repair corrupted server files
Home > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Integrating a Notes Connector database with Google Enterprise Search
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Five trends for 2010
DominoPower TV Episode 1: Inside a strategy session with Teamstudio
More about Domino log files
Say goodbye to the Uh-Ohs. Long live the Tens.
Why your log.nsf might not be purging properly
Latest Lotus Headlines
SnTT: XPages Blank Calendar Control (Part 2), adding data
Have your Lotus Notes calendar display multiple time zones
Sample Database for Microsoft Office and Lotus Symphony Integration
Symphony 3.0 beta signals another attack on Office
Enabling DAOS on a database - new recommendation
Need your opinion on some new policy settings for Mail
Sometimes IBM Lotus Domino HTTP RPC Agents aren't the answer...
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad: Apple's latest heartbreaker
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Running auto-respond rules when Outlook is closed
-- Advertisement --

Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done. Native to Lotus Domino. The User Experience unseen for Lotus Domino. Do more with less. Really.

See the possibilities Docova unleashes for Lotus Domino.
-- Advertisement --

Teamstudio announces the 2010 spotlight awards winners!
We had some extraordinary submissions for the 3rd annual Teamstudio Spotlight Awards, and choosing the winners was no easy task for our judges! Click here to find out who won, and to learn more about these remarkable applications and the genius developers behind them!

Tap here for more information.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login