kali958
asked on
Run schedule agent on specific view
I need to have a agent run on documents in a view at night to update them and send an email to Supervisors.
I currently have written this:
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim agent As NotesAgent
Set db = s.CurrentDatabase
Set view = db.GetView( "lkupPendingRequests")
Set agent = db.GetAgent("Supervisor")
End Sub
I feel that I am missing something to actually kick off the agent. When I run the agent Supervisor manually it works but when run it scheduled, it will not run. Any ideas?
I currently have written this:
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim agent As NotesAgent
Set db = s.CurrentDatabase
Set view = db.GetView( "lkupPendingRequests")
Set agent = db.GetAgent("Supervisor")
End Sub
I feel that I am missing something to actually kick off the agent. When I run the agent Supervisor manually it works but when run it scheduled, it will not run. Any ideas?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Oh, and if your view- processing code is in agent Supervisor, then there is no need to get the view or document before starting mentioned agent.
Or did I misunderstood something?
Or did I misunderstood something?
ASKER
I do not want to run the agent on all the documents in the database.
I have a selection on the view that if the ContactName != Supervisor, I want to send a email notification to the Supervisor so they can approve the request.
So I thought, I would create the view, create the agent, and then schedule the agent to run at 1:00 AM on the that view but not all the documents. Am I missing something or is there a easier way?
I have a selection on the view that if the ContactName != Supervisor, I want to send a email notification to the Supervisor so they can approve the request.
So I thought, I would create the view, create the agent, and then schedule the agent to run at 1:00 AM on the that view but not all the documents. Am I missing something or is there a easier way?
I hope this helps !