Dear experts,…
I have problem in scheduled agent in domino R7.
it seem like loop is not working
While Not cdoc Is Nothing
Set maildoc = New NotesDocument (db)
…
Set Cdoc = view.GetnextDocument(Cdoc)
Wend
but loop will run if i run manually from notes client
but if i run as scheduled agent, the loop is not works,
Anybody know what’s wrong with my simple coding as below ?
agent also sign by server ID
'==================================
On Error Goto label
Dim db As NotesDatabase
Dim session As New NotesSession
Set db = session.Currentdatabase
Dim view As NotesView
Set view= db.GetView (“sampleview”)
Dim Cdoc As NotesDocument
Set Cdoc = view.GetFirstDocument
While Not cdoc Is Nothing
'=====notification loop run or not
Set maildoc = New NotesDocument (db)
maildoc.form=“Memo”
maildoc.sendto=“userxxx”
maildoc.subject="loop run "
Call maildoc.send(False)
Set Cdoc = view.GetnextDocument(Cdoc)
Wend
'======= notification if agen run
Set maildoc = New NotesDocument (db)
maildoc.form=“Memo”
maildoc.sendto=“userxxx”
maildoc.subject=“agen run”
Call maildoc.send(False)
End
label:
'notification if agen error
Set maildoc = New NotesDocument (db)
maildoc.form=“Memo”
maildoc.sendto=“userxxx”
maildoc.subject=“agent error”
Call maildoc.send(False)
'========================