Wednesday, 2 December 2015

Quick Tip - View actions leave documents selected after execution using the UnprocessedDocuments property of the NotesDatabase class

Yesterday I came across the problem that documents remained selected after a View Action was executed. In the view were repeatedly a number of documents selected to be processed.
The problem concerned a LotusScript agent using the UnprocessedDocuments method. I initially tried, by using the UpdateProcessedDoc method, to provide the documents of a 'processed stamp' so that these documents would not be processed  by the same Agent again. Unfortunately, this had no effect and the documents remained selected when the View Action was executed again for the next documents. The strange thing was that the documents were no longer visible in the view after they were processed but nevertheless remained selected.

On the IBM Support site I came across the following Technote (FAQ), View actions leave documents selected after execution in which my problem was described

Question
After executing a View action in Notes/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.

The final solution (workaround) consists of the addition of 'CurrentView.DeselectAll' in de LotusScript Agent.

No comments:

Post a Comment