Search DominoPower's 11,441 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.
Little known traps about Lotus Notes fields (continued)

You can also get some other strange effects from the lack or typing, too, and the fact that Notes displays on the screen whatever is in the underlying field, regardless of the data type. Imagine the frustration and the small amount of swearing that goes on when you see Notes proudly display 10.00 in a field where you have set the number format to have no decimal places - expecting to see the value 10. Just how long did it take to spot that the actual value in the field was text "10.00", so that's what Notes displayed.

Hide-whens and Rich Text fields
Then there's the one about hide-whens and Rich Text fields. Never, ever, use a hide-when to hide or expose an editable Rich Text field, or, for that matter, a non-editable one. This is because, in a Rich Text field, unlike any other type of field, the value can itself contain hide-whens.

Worse, when you create the value of a Rich Text field by editing it via a form, the first paragraph (at least) of the field will inherit the hide-when from the form, and then carry it along with the the data. When the field is displayed, it will react to the hide-when with its own data, and not the hide-when on the form.

Worse, again, if your users copy and paste the Rich Text data, or you programmatically copy it from field to field, that copied value still contains the hide-when values from the source field, and which may well not be what you want at the target location.

Worse, even more, should you change the hide-when on the form, none of the Rich Text data will respond to that, because it will always respond to the hide-whens in its own data. So you then find that data that should be visible isn't, and data that shouldn't be, is visible, depending of course on the circumstances.

And you can't programatically get to the stored hide-when data to fiddle with it either, unless you get very clever with the Notes API. For an application robustness and maintainability perspective, I don't think you'll want to go there.

If you need to work with hide-whens and Rich Text, you need instead to use a computed subform, and on that subform, you place the Rich Text field, and you don't use any hide-whens to manage the Rich Text field. What you do instead is to include or not include the subform as appropriate on the form, and in this way the whole Rich Text field will either be visible and editable or not reachable at all.

The downside of this technique is that you need to close and reopen the document to change whether the Rich Text data is displayed or not, because that's the only way to get the computed subform expression reevaluated.

View columns
Lastly, while we are dealing with fields, is a little-known feature of view columns. You're aware, no doubt, that on the properties for a view column, on the fourth tab, you can select a data type, and for that type, say how the data is to be formatted? See Figure A as a reminder.

FIGURE A


The view column properties shows the different format types that can be defined. Roll over picture for a larger image.

Well, if the data that you display in that column is of different types, did you know that you can select each of the four format types and make relevant selections, and Notes will format the displayed data to suit?

This means that should you, say, display a date from one document type and a number from another in the same column, you can properly define in the column how the data is to be formatted - and doing that will be faster than using @functions in the column value, too.

Product availability and resources
Read "Notes is not a relational database".
Mick Moignard has been working and traveling with Lotus Notes since Release 2.0 in 1991. Mick is a DominoPower Senior Technical Editor and a Principal CLP with Unipart Expert Practices, a Lotus Advanced Partner in the UK. If you want to discuss anything to do with this article, or indeed anything else to do with Notes and Domino, contact Mick at Mick_Moignard@unipart.co.uk. Unipart Expert Practices will also happily discuss any opportunities you may have with any Notes and Domino application development or infrastructure projects you need help with. Unipart Expert Practices can be found at http://www.unipartep.com.


« Previous  ·  1  ·  2  ·  3
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
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.

Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).

Tap here to get started!

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