After executing a View action in Lotus Notes®/Lotus Domino®, documents that were selected prior to running the View action are still selected, even when one or more documents no longer appear in the view. This can have adverse effects because a user may not realize that documents in other views may be selected when they execute the same action, a second action, or an agent that acts on currently selected documents.
Example of an adverse effect:
An action uses LotusScript to act on selected documents using the UnprocessedDocuments property of the NotesDatabase class. If the action modifies documents so that they no longer appear in the view, a user would not realize that the documents were still selected after running the action. If the same View action is executed again (or another action that also uses the UnprocessedDocuments property), then documents in other views could be acted upon without the user realizing it.
This issue was reported to Quality Engineering as SPR# MOR4FWM4C. There are no plans to address this issue since existing functionality allows the issue to be avoided by Simple Action and Formula actions, Also, functionality introduced in LotusScript in Notes/Domino 6 releases can also be used.
* For Formula or Simple Action actions, call the @Command EditDeslectAll as the last line of the action. If using other @Command calls, then call EditDeselectAll as a @PostedCommand.
* For LotusScript actions in Notes/Domino 6.0 and later releases, use the EditDeslectAll method (of the NotesUIView class). The NotesUIWorkSpace class provides a handle to the current view using the CurrentView property, and the DeselectAll method call can be based on that (NotesUIView) object handle.
NOTE: The code below is a sample script, provided to illustrate one way to approach this issue. It is to be used as is and at your own risk. In order for this example to perform as intended, the script must be laid out exactly as indicated below. Product Support cannot customize this script for specific environments or applications.
Sub Click(Source As Button)
Dim s As New notessession
Dim db As notesdatabase
Dim col As notesdocumentcollection
Dim w As New notesuiworkspace
While Not (doc Is Nothing)
* LotusScript workaround for Notes/Domino releases prior to 6.0.
The following workaround can be used to ensure that selected documents are deselected when the action finishes execution:
1. Place the view action's LotusScript code within an agent that acts on Selected Documents.
2. Have the view action call the agent in Step 1 using the following formula:
|Messaging Applications||IBM Domino Designer||Not Applicable||Windows||9.0, 8.5, 8.0, 7.0, 6.5, 6.0||All Editions|