
 | 

Replacing the No documents found message
Tip submitted by
Dimple Rao


Level: Intermediate
Works with: Notes and Domino
Updated: 12/02/2002

Related link:
More Tips from LDD | 
 | 
Typically, when you search a view for documents and no documents are found, you receive the message No documents found. If you find this message unfriendly or unhelpful, you can replace the message with a customized one, such as Sorry, no documents found in this view. This tip works on the Web, but not in the Notes client, and requires that you use a view template to display a view.
- In Domino Designer, open the view template you want to customize.
- In the template, add a hidden Computed-for-display field named hasDocs. Include the following code as the field's formula.
result:=@dbcolumn("":"nocache";"";<viewname>;<column no>);
@if(@iserror(result)|@elements(result)=0;"0";"1")
Replace the <viewname> with the name of the view that the template applies to and replace <column no> with a column number or "".
- Add <span> tags to the template around either the embedded view or the $$ViewBody field to the template:
<span style="display:<computed value>">the embedded view or $$ViewBody field</span>
- Right-click the <span> tag, and then select Text Properties from the menu to open the properties box.
- Select the Paragraph Hide When tab, then add the following formula:
@if(hasDocs="0";"none";"default")

- Add a second set of <span> tags with the custom message that you want to have appear in place of the No documents found message as follows:
<span style="display:<computed value>">custom message</span>
The following screen shows an example of a view template with a custom message.

- Open the Text Properties box, select the Paragraph Hide When tab, and then add the following formula:
@if(hasDocs="0";"default";"none")
- Save and close the view template.
The next time your you search the view, if no documents are found, the message that appears is your custom message.
SUBMIT YOUR TIPS! |
We encourage you to send us your tips (You can also click the "Would you like to submit a tip?" graphic below.) Your tips can be anything you've discovered about any Lotus product. The most important thing is that your tip be interesting, useful, or handy. And be sure to include complete information about how your tip works. For ideas, take a look at our tip archives. If we publish your tip, we'll send you the IBM Redbooks Lotus Collection on CD. |
|
| 
 |