 |
 Duplicate documents Filter in a view lathan reddy 04/17/2012 10:24 AM Domino Designer 6.5.2 Windows XP
Hi All,
Need To Filter the Duplicate documents in a view (Suppose Employee Id :5632 have five documents,I need to filter those 5 documents into one view).Below code i could not able to get 5 documents i can able to filter 4 documents.
Suppose if i filter those five documents into one view( Duplicatedocuments view) which are having same employee id 5632. after filterd i have deleted 4 documents from (Duplicatedocuments view) there is one more document have employee id 5632 Right. that document automatically move to main view (Why because we dont have same duplicate id documents right)
Can you Pleas adjust the code some one please accordingley
("Duplicatedocuments view") view selection formula SELECT Form ="Employee" & isdup="Yes"
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim dup As NotesDocument
Dim vu As NotesView
Dim vecoll As NotesViewEntryCollection
Dim ventry1 As NotesViewEntry
Dim ventry2 As NotesViewEntry
Set db=s.CurrentDatabase
Set vu=db.GetView("X")
Set vecoll = vu.AllEntries
If vecoll Is Nothing Then
Exit Sub
End If
Set ventry1 = vecoll.GetFirstEntry
Set doc=ventry1.Document
While Not doc Is Nothing
Set ventry2=vecoll.GetNextEntry(ventry1)
If ventry2 Is Nothing Then
Exit Sub
End If
Set dup = ventry2.Document
'Msgbox doc.EID(0)+"and"+dup.EID(0)
While doc.EID(0)=dup.EID(0)
'Msgbox doc.EID(0)
Set ventry2=vecoll.GetNextEntry(ventry2)
dup.isdup="Yes"
Call dup.Save(True,False)
If ventry2 Is Nothing Then
Set dup=Nothing
Exit Sub
Else
Set dup=ventry2.Document
End If
Wend
Set ventry1=ventry2
If ventry1 Is Nothing Then
Set doc=Nothing
Else
Set doc=ventry1.Document
End If
Wend
Go back |