Hey folks,
I have a bit of a challenge here. I need to gather a collection from a view using a date range. From that collection, I need to create several other collections, but the real challenge is ensuring that the other collections are the result of the first and that as I step through the original collection, I am grabbing unique records to get the other collections.
For example, I would like to search for all Helpdesk tickets created between two dates. Using this, I would then like to step through this collection, and create additional collections, which should be unique. More specifically, once I have my range, I then would like to grab all High, Medium and Low priority tickets.
Here’s where I am so far:
dim session as NotesSession
dim db as NotesDatabase
Dim view as NotesView
dim nav as NotesViewNavigator
dim entry as NotesEntry
dim doc as NotesDocument
dim vdoc as NotesDocument
set db = session.CurrentDatabase
set doc = session.DocumentContext
Set view = db.GetView(VIEWNAME)
search$ = |[Form] = “Tickets” AND[Closed_Date] >= | & doc.FromDate(0) & | AND [Closed_Date] <= | & doc.ToDate(0)
q = view.FTSearch(search$, 0 )
If q > 0 Then
Set nav = view.CreateViewNav
Set entry = nav.GetFirstDocument
Set vdoc = entry.Document
While Not (vdoc Is Nothing)
currentMonth = Month(vdoc.Closed_Date(0))
search$ = |[Form] = “Ticket” AND [Priority] = “High” & @Text(@Month(Closed_Date) = currentMonth & |
Set highDC = db.FTSearch(search$, 0)
search$ = |[Form] = “Ticket” AND [Priority] = “Medium” & @Text(@Month(Closed_Date) = currentMonth & |
Set MedDC = db.FTSearch(search$, 0)
search$ = |[Form] = “Ticket” AND [Priority] = “Low” & @Text(@Month(Closed_Date) = currentMonth & |
Set lowDC = db.FTSearch(search$, 0)
Set entry = nav.GetNextCategory(entry)
If Not entry Is Nothing Then Set entry = nav.GetNextDocument(entry)
Wend
End if ’ q
Thanks,
Cyg