Manage Learn to apply best practices and optimize your operations.

Run selected agent on server

This tip describes how to Run selected agent on server.

For testing purposes you often have to test scheduled agents which only run on server. With this agent you can select all scheduled agents in a database and run them on server.


 Option Public
Option Declare

Sub Initialize
 Dim s As New NotesSession
 Dim ws As New NotesUIWorkspace
 Dim db As NotesDatabase
 Dim agent As NotesAgent
 Dim selAgent As Variant
 Dim i As Integer
 On Error Goto Fehler
 
 Set db = s.CurrentDatabase
 
 Forall a In db.Agents
  If a.Trigger = 1 Then
   Redim Preserve varAgent(i)
   varAgent(i) = a.Name
   i = i + 1
  End If
 End Forall
 
 selAgent = ws.Prompt( PROMPT_OKCANCELCOMBO, "Auswahl des Agenten", _
 "Bitte einen Agenten auswahlen: ", varAgent(0), varAgent) 
 If selAgent = "" Then Exit Sub 
 Set agent = db.GetAgent(selAgent)
 If agent.RunOnServer = 0 Then 
  Print "Agent ist gelaufen."
  Exit Sub  
 Else
  Msgbox "Agent konnte nicht gestartet werden.", 64, "Hinweis" 
 End If
 Exit Sub
 
Fehler:
 
 Msgbox "Error (" & Cstr(Err) & " ) -≶ " & Error$(Err), 16, "Agent: Run Agent on Server"
 Exit Sub
End Sub

Dig Deeper on Domino Resources - Part 5

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close