Monday, 9 April 2018
The Power of LotusScript Part IV - CurrentView.DeselectAll
The Power of LotusScript
Part I - Create New Document From UIdocument Using LotusScript
Part II - LotusScript Agent Send Email to Multiple Receipients (Per Recipient) Including a Doc Link Based on a Search Formula
Part III - Quick Tip - OpenDocumentInUI - OpenDocumentOtherDBInUI
Part IV - CurrentView.DeselectAll
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
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.
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)
I hope that the above solution will help someone with the same problem that I encountered now for the second time. In my next blog posts more LotusScript Functions and Agents that I have implemented during the past period in various Notes applications.
Geplaatst door Johnny Oldenburger op Monday, April 09, 2018