Reputation: 77
I created a view where the first column could be any of three different names on a form. I would like to have an agent go through each document in the view and create an email for each person in the view with information from the document(s) pertaining to that person. Each person can be any of the three name fields on the form, but they can only be on the form once, so if there are 5 documents for a person, there could be 3 in name a, 1 in name b, and 1 in name c.
My issue is coming up when I try to get the value in the first column for the document. Since getting the first document only gets me a document that contains 3 names, I need to know which name is in the column I am up to in the view. Because I will be processing this document again when I get to the people in the other two fields, but I have to do this alphabetically and I have to do all documents for one person before moving to the next person in the view.
Is this something that can be done using this view or do I have to do a search on each name and grab the documents for each person that way. I thought there was an easy way to simply get the view column value, but for my example here, I am not sure how that would work. Or it is something very simple that I am just having a brain cramp on.
Thanks in advance.
Upvotes: 1
Views: 4460
Reputation: 14628
You could make the formula for the first column something like this
(fieldA +"^A") : (fieldB +"^B") : (fieldC + "^C')
Addition of a list with a scalar will append the scalar to each element of the list, so each name in the column would be tagged with the name of the originating field. You should end up with something like this:
Adam Abel^A
Adam Abel^A
Adam Abel^C
Bob Baker^B
Carl Cook^A
Carl Cook^B
David Day^B
David Day^C
David Day^C
And then it's just simple matter of splitting the name from the field id while looping through the column entries.
Upvotes: 2
Reputation: 22284
If I'm following you correctly, you should be able to loop through the view entries instead of the documents using the NotesView's AllEntries
property. Within each entry (i.e. NotesViewEntry object) there is a column values property so you can get the specific column value that shows for that specific entry.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim entry As NotesViewEntry
Dim vc As NotesViewEntryCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.getView("My View")
Set vc = view.AllEntries
Set entry = vc.GetFirstEntry()
While Not (entry Is Nothing)
*** Process columns from entry here ***
Set entry = vc.GetNextEntry()
Wend
Upvotes: 2