You need to get a handle on the successive documents in the view. If the name of the next document is not the same, then you process the current document. Some sample code might look like this.
Sub Initialize Dim session As New NotesSession Dim db As NotesDatabase Dim docThis As NotesDocument Dim docNext As NotesDocument Dim view As NotesView Dim item As NotesItem Dim itemName As NotesItem Dim strName As String Dim varProcess As Variant Set db = session.Currentdatabase Set view = db.Getview("your view name") Set docThis = View.getFirstDocument() strName =docThis.Name(0) While Not (docThis Is Nothing) varProcess = False Set docNext = View.getNextDocument(docThis) If (docNext Is Nothing) Then 'last document in view varProcess = True Elseif (docNext.Name(0) = strName) Then 'do Nothing varProcess = False Else 'this is the last document for this person varProcess = True End If If varProcess Then 'process the leaveDays field - add your code 'set the name to the next person strName = docNext.Name(0) End If Set docThis = docNext Wend End Sub
Do you have comments on this Ask the Expert Q&A? Let us know.
Dig Deeper on Lotus Notes Domino Agents
Related Q&A from Brian Mahoney
Find out what types of calculations can be computed for a column in a Lotus Notes view and the best way to go about it with this expert response. Continue Reading
Find out why you can't use Formula language to include a doclink to a specific Lotus Notes view or database and need to use LotusScript instead. Continue Reading
Discover the reasons behind a Notes/Domino admistrator having trouble with disabled options in the "customize this view" section of his Lotus Notes ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.