Sasha S 20.May.12 10:25 PM a Web browser Applications DevelopmentAll ReleasesAll Platforms
Hello gurus -
I am seeking your help with this LS agent that is suppose to retrieve the column values from a view, based on a particular category and send an email to those listed in the column values. The column values may be a single/multi-value.
Once all the values are retrieved, they need to be written to the SendTo field in a memo so that a single email can be sent out to all the recipients. The agent gets the names listed in the 2nd document; however, it omits the names in the 1st doc and docs 3-5. How can I get all the names in from all the docs.
Note: the agent works fine if there is only a single value in the field; but if multi-value, it doesn't work. Thoughts please?
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim viewColl As NotesViewEntryCollection
Dim Viewentry As NotesViewEntry
Dim i As Integer
Dim j As Integer
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView("MainFormView")
Set viewColl = view.GetAllEntriesByKey("hello", True)
Set Viewentry = viewColl.GetFirstEntry()
i=0
While Not (Viewentry Is Nothing)
ReDim Preserve names(i)
names(i)= Viewentry.ColumnValues(1)
Set Viewentry = viewColl.GetNextEntry(Viewentry)
i=i+1
Wend
Set doc =New NotesDocument(db)
doc.form ="Memo"
For j=0 To UBound(names,1)
doc.Sendto = names(j)
Next