Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Run schedule agent on specific view

Posted on 2008-06-09
4
Medium Priority
?
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

597 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