Solved

Run schedule agent on specific view

Posted on 2008-06-09
4
221 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Invoke VBA from lotusscript after mailmerge 11 231
Lotus Notes default email application problem 6 115
Lotus Notes Calendar Help 6 98
Cannot access mail archive from IBM domino 5 101
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

15 Experts available now in Live!

Get 1:1 Help Now