Solved

Run schedule agent on specific view

Posted on 2008-06-09
4
219 Views
Last Modified: 2013-12-18
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?
0
Comment
Question by:kali958
  • 2
4 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 21746676
You need to execute the agent as scheduled, , and have it get the documents/ view. Why do you need two separate processes ?


I hope this helps !
0
 
LVL 7

Accepted Solution

by:
olaraak earned 500 total points
ID: 21747008
Think you just miss the last row, to run agent after you got it:

Agent.Run()

:-)
This function returns Integer; 0=success

it can be used like:

If Agent.Run()=0 Then
   Print "Agent ""Supervisor"" ran successfully"
Else
  Print "Some kind of error occurred"
End If

On the other hand,

1.  the agent Supervisor trigger can be changed to schedule
2. it would be simpler  to use Simple actions in one agent to run another
3. or use @Command( [RunAgent] ; "Supervisor ") instead of LotusSript

But yes, the Agent.Run() should also do.
0
 
LVL 7

Expert Comment

by:olaraak
ID: 21747041
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?
0
 

Author Comment

by:kali958
ID: 21750345
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?
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now