In a previous article I wrote on how to work with Lotus Notes ListBox fields. Unfortunately these type of fields have a major drawback, their limit of only 32 kb of text. So if you want to display thousands of entries you must use an embedded view. This is an small example of using an embedded view in an form, that shows how to retrieve the selected documents or currently highlighted in the view and process those documents:
Sub CopyDocuments(itemName As String) Dim session As New NotesSession Dim db As NotesDatabase Dim uidoc As NotesUIDocument Dim uiview As NotesUIView Dim doc As NotesDocument Dim tempDoc As NotesDocument Dim dc As NotesDocumentCollection Dim item As NotesItem Dim uiw As New NotesUIWorkspace Set db = session.Currentdatabase Set uidoc= uiw.currentdocument Set doc = uidoc.Document Set item = doc.GetFirstItem(itemName) Set uiview = uiw.Currentview Set dc = uiview.Documents 'add currently focused document from the embedded view If (dc.Count = 0 ) Then Set tempDoc = db.GetDocumentByID(uiview.CaretNoteID) Call dc.AddDocument(tempDoc) End If Call uiview.Deselectall() ' process the selected documents Call AppendDocumentsToList(item, dc) Call uidoc.refresh End Sub |
First we get the current view in the workspace using uiw.Currentview. This returns a NotesUIView class that has an property called Documents that represents the documents selected(checked in the selection margin) in the view.
If there is no document checked in the embedded view(dc.Count = 0) the currently highlighted document will be used.
After retrieving the document(s) we need to process them. In this example some data from these documents are copied in a ListBox field for displaying. However this code will work correct if it is placed as an action in the embedded view. So you can create an Lotus Script agent that uses this code and is called from the a view’s action. If you try to put this code outside the view(into an button click event for example) you will get an “Object not set” message meaning you have no NotesUIView object.
When working with large number of documents is crucial to be able to search the documents. In order to do this, in the view that is shown in the embedded view you must have an hidden column set as first column. Having this hidden column, when the view is focused and you start to type a “Starts with…” dialog will be opened and on enter key press, if there are documents with fields matching your criteria they will appear first in the view. If you want to search on multiple fields you can set the embedded view to use different views with different first hidden column.
Another problem that I had was in the AppendDocumentsToList procedure when the embedded view used different views. After processing the documents I wanted to refresh the form to reflect the changes but calling uidoc.refresh caused Lotus Notes client to crash. This issue appeared only when I was using multiple views. It seams that it is a bug when you use an embedded view in an dialog box. Moving the call to uidoc.refresh out of AppendDocumentsToList code and placing into the CopyDocuments fixed the problem.
References:
IBM Lotus Domino and Notes Information Center
Finally, there’s another very important peculiarity of what does Cialis that brings it so high above its alternatives. It is the only med that is available in two versions – one intended for use on as-needed basis and one intended for daily use. As you might know, Viagra and Levitra only come in the latter of these two forms and should be consumed shortly before expected sexual activity to ensure best effect. Daily Cialis, in its turn, contains low doses of Tadalafil, which allows to build its concentration up in your system gradually over time and maintain it on acceptable levels, which, consequently, makes it possible for you to enjoy sex at any moment without having to time it.
Nice Information.. Thx for sharing this
information
June 13, 2010 at 4:49 pmGreat post!
June 15, 2010 at 6:05 pmNice article. Thank you for this info
July 31, 2010 at 8:44 pmYou have hit the mark. In it something is also to me it seems it is good idea. I agree with you.
September 15, 2010 at 4:54 pm