I have an Agent that copies documents from Database-A to Database-B and then deletes them from Database-A. If I run the Agent manually its works just fine. But as soon as I change that Agent to “Scheduled”, nothing happens. If I check the server log there are no errors, theres not even a log showing it tried to run. I have the schedule set to every 5 minutes during business hours for testing purposes.
I am thinking its somthing to do with the ACL? I dont think anything is wrong with the code, but here it is anyway:
Sub Initialize
Dim archiveDb As New NotesDatabase( "SCILKL1NS/SCI", "JWDtestTo.nsf" )
Dim doc As NotesDocument
Dim item As NotesItem
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Set db = session.CurrentDatabase
Set archivedb = session.GetDatabase( "SCILKL1NS/SCI", "JWDtestTo.nsf" )
Set view = db.GetView( "PS3_Profiles")
Set doc = view.GetLastDocument
While Not (doc Is Nothing)
Set item = doc.ReplaceItemValue( "ArchivedDateFlag", Now )
Call doc.Save( False,False )
Call doc.CopyToDatabase( archiveDb )
Call doc.Remove(True)
Set doc = view.GetLastDocument
Wend
End Sub