Having trouble writing agent and getting it to work. I need an agent to Refresh all documents in the database that the form = “Leave”.
The agent needs to run on the server @ night when nobody is in the office. Can this be done? Having problems getting it to work.
Thanks in advance for the help.
Subject: Refresh Agent
create a view of all the documents with the form = “Leave”. you can then call this view in the agent below to refresh and update all the documents. the trigger should be set to "on schedule and should run daily at whatever time you select it to run.
jason
jasonsmith@columbusga.org
Sub Initialize
Dim session As New notessession
Dim db As notesdatabase
Dim view As notesview
Dim doc As notesdocument
Set db = session.currentdatabase
Set view = db.getview("Leave Form View")
Call view.refresh
tmp = view.autoupdate
view.autoupdate = False
Set doc = view.getfirstdocument
While Not doc Is Nothing
Call doc.computewithform(True, False)
Call doc.save(True, False)
Set doc = view.getnextdocument(doc)
Wend
view.autoupdate = tmp
End Sub
Subject: RE: Refresh Agent
I had this LS working as a scheduled Agent on a server without any problem when it was running off a view with a few dozen documents. I’ve been trying it with a view with a few thousand documents and it won’t run - I’ve tried running it late at night too. Any thoughts?