Any idea why this agent does not pull any documents from the AllRequests view?
Dim agentLog As New NotesLog("Agent log")
Call agentLog.OpenAgentLog
On Error Goto errorhandling
Dim s As New notessession
Dim db As notesdatabase
Set db = s.currentdatabase
' Report docs
Dim view As notesview
Dim doc As notesdocument
Dim routedoc As notesdocument
Set view = db.getview("AllReportingDocs")
Set doc = view.getfirstdocument
While Not (doc Is Nothing)
Set routedoc = view.getnextdocument(doc)
Dim defview As notesview
Dim defcollect As NotesDocumentCollection
Dim defdoc As notesdocument
Dim defroute As notesdocument
Set defview = db.getview("AllRequests")
requestID=doc.Rpt(0)
Set defcollect = defview.GetalldocumentsByKey(requestID)
Set defdoc = defcollect.getfirstdocument
While Not (defdoc Is Nothing)
Set defroute = defcollect.getnextdocument(defdoc)
agentLog.LogAction("found: "+defdoc.qNum(0))
nextdef:
Set defdoc = defroute
Wend
nextdoc:
Set doc = routedoc
Wend
Thanks for your help!!!