I have created a agent,when i am runnning that agent manually it works fine,but if i schedule it,it does not runs.i checked it from log.nsf i am getting the following error.4/25/2005 08:00:16 AM AMgr: Agent (‘ManagersReminder’ in ‘Request.nsf’) error message: Error creating product object
Subject: Schedule Agent not working
Are you using any UI objects in your code? If you are, then the agent won’t run.
HTH
Julie
Subject: RE: Schedule Agent not working
No there is no UI,Intially it was working but now it’s not working
Subject: RE: Schedule Agent not working
Post your code … its difficult to guess whats going on !
Subject: RE: Schedule Agent not working
Here is the code
Dim ss As New NotesSession
Dim db As notesdatabase
Dim thisdoc As notesdocument
Dim note As notesdocument
Dim todaydate As New NotesDateTime( "Today" )
Dim datelogged As New NotesDateTime( "" )
Dim rno As Variant
Set db=SS.CURRENTDATABASE
Set view=db.getview("Requests\All")
Set doc=view.getfirstdocument
Set vdoc=view.getfirstdocument
While Not doc Is Nothing
If doc.status(0)="0.1" Then
datelogged.LSLocalTime=doc.logged(0)
If todaydate.DateOnly >= datelogged.DateOnly Then
Set mdoc =New NotesDocument( db )
Dim rtitem As NotesRichTextItem
Set rtitem = New NotesRichTextItem( mdoc, "Body" )
rno=doc.r_reno(0)
subj = "Request Number "+""+ Cstr(rno) +""+ "for New/Upgrade Software is Pending for your Approval/Rejection"
msg = "Request Number " + ""+ Cstr(rno) +""+ " is pending For your Approval/Rejection."
mdoc.Form="Bookmark"
mdoc.Principal="R SYS"
mdoc.ReplyTo=sndto
mdoc.From="R SYS"
mdoc.SendTo=doc.r_manager(0)
mdoc.CopyTo=doc.crby(0)
mdoc.Subject=subj
Call rtitem.AppendText(msg)
Call rtitem.AppendDocLink(doc ,"Click here to proceed")
Call mdoc.Send(True)
End If
End If
Set doc = view.getnextdocument(doc)
Wend
Subject: RE: Schedule Agent not working
I have added an error handler in the code which will print out the line number ( so thats easy to debug )
On Error Goto ErrorHandler
Dim ss As New NotesSession
Dim db As notesdatabase
Dim thisdoc As notesdocument
Dim note As notesdocument
Dim todaydate As New NotesDateTime( "Today" )
Dim datelogged As New NotesDateTime( "" )
Dim rno As Variant
Set db=SS.CURRENTDATABASE
Set view=db.getview("Requests\All")
Set doc=view.getfirstdocument
Set vdoc=view.getfirstdocument
While Not doc Is Nothing
If doc.status(0)="0.1" Then
datelogged.LSLocalTime=doc.logged(0)
If todaydate.DateOnly >= datelogged.DateOnly Then
Set mdoc =New NotesDocument( db )
Dim rtitem As NotesRichTextItem
Set rtitem = New NotesRichTextItem( mdoc, "Body" )
rno=doc.r_reno(0)
subj = "Request Number "+""+ Cstr(rno) +""+ "for New/Upgrade Software is Pending for your Approval/Rejection"
msg = "Request Number " + ""+ Cstr(rno) +""+ " is pending For your Approval/Rejection."
mdoc.Form="Bookmark"
mdoc.Principal="R SYS"
mdoc.ReplyTo=sndto
mdoc.From="R SYS"
mdoc.SendTo=doc.r_manager(0)
mdoc.CopyTo=doc.crby(0)
mdoc.Subject=subj
Call rtitem.AppendText(msg)
Call rtitem.AppendDocLink(doc ,"Click here to proceed")
Call mdoc.Send(True)
End If
End If
Set doc = view.getnextdocument(doc)
Wend
Exit Sub
ErrorHandler:
message = Error$ +" at line number . " + Cstr(Erl)
Print message
Resume quitRoutine
quitRoutine:
Exit Sub
cheers !!
Ashish