|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 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! |
|
|
|
|
|
|
|
|
|
|