TechTip--Display Rich Text Fields in Domino Views

Collaboration & Messaging
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Q: Lotus Notes/Domino cannot display Rich Text fields within the columnar format of a view. For instance, I need to create a view of documents that contain the field called $Body. However, I can't create a column that will display the field in the view because it was defined as a Rich Text field. Is there some way around this? I need to be able to see the contents of the $Body field in a column of the new view that I am creating.

A: Lotus views can't directly display a Rich Text field. However, you can create a formula that extracts the text content of the Rich Text field to store that text in a hidden field that is defined as a simple Text field. Then, within the view you wish to create, you would define a column that displays the hidden field instead of the Rich Text field.

This is done using an @ function called @Abstract with the TextOnly command.

Create the hidden text field on the form that you want to display in your view. In our example, let's call this field HiddenUserField. This field should be defined as a "Computed when composed" field as shown in the figure below:

http://www.mcpressonline.com/articles/images/2002/Tip%20for%20displaying%20Rich%20Text%20fields%20in%20Domino%20ViewsV300.png

Within the "Value" definition of this field, enter the following formula using the @Abstract function:

@Abstract( [TextOnly] ; 64000 ; "" ; "$Body" )

Now, when the $Body field is created or changed within the form, the text contained within that field will be extracted and placed into the HiddenUserField. If you subsequently create a Notes/Domino view, you can create a column that displays the HiddenUserField, and the contents will be made available within the view.

Note: This technique will work for every newly created or changed $Body field within the form. However, for older documents that have not been updated, the value of HiddenUserField will remain uncomputed until you refresh the values of the $Body field within the document. Do this manually by opening each document in edit mode and pressing F9 or by writing an agent that goes through the database performing an @Command([RefreshHideFormulas] ) command for the form.

--Thomas M. Stockwell
This email address is being protected from spambots. You need JavaScript enabled to view it.

MCMagOnline pays for tips!
Send your tips to
This email address is being protected from spambots. You need JavaScript enabled to view it.

BLOG COMMENTS POWERED BY DISQUS