Accessing agents
The NotesAgent class represents an agent. You can access the current agent through the CurrentAgent property of NotesSession; this property is empty if the script is not running as an agent. You can access all agents in a database through the Agents property of NotesDatabase; this property is empty if the database contains no agents. You can access a named agent in a database through the GetAgent method of NotesDatabase.
The following table lists the NotesAgent properties:
Property |
Data type |
Description |
---|---|---|
String |
(Read-only) Comment entered by agent designer |
|
String |
(Read-only) Common name of the user who last modified the agent |
|
Boolean |
(Read-only) True if the agent has run since it was created or last modified |
|
String |
(Read-only) The HTTP URL of an agent. |
|
Boolean |
(Read-only) True if user activation is in effect when enabling an agent. |
|
Boolean |
(Read-write) True if the agent can run. |
|
Boolean |
(Read-only) True if the agent can run in the Domino® client environment |
|
Boolean |
(Read-only) True if the agent is public |
|
Boolean |
(Read-only) True if the agent can run in a Web browser environment |
|
Date variant |
(Read-only) Date that the agent last ran |
|
String |
(Read-only) Name of the agent |
|
String |
(Read-only) The Notes® URL of an agent. |
|
String |
(Read-only) Name of user under whose identity a scheduled or Web agent runs. |
|
String |
(Read-only) Name of the creator of the agent |
|
String |
(Read-only) The note ID of a document |
|
NotesDatabase |
(Read-only) Database that contains the agent |
|
String |
(Read-only) Query used by the agent to select documents |
|
String |
(Read-write) Name of the server on which the agent runs |
|
Boolean or Constant |
(Read-only) Indicates which documents the agent acts on |
|
Boolean or Constant |
(Read-only) Indicates when the agent runs |
The NotesAgent class contains a Remove method to remove the agent from the database.
The SavedData property of NotesSession returns a NotesDocument object. The agent can use this document to store data that is persistent across invocations of the agent. However, if the agent is modified in any way, the saved data document is cleared. This document is not accessible from the parent NotesDatabase object or from a NotesView object.
The Run method runs the agent on the computer running the current program. The RunOnServer method runs the agent on the computer containing the agent's database.
The GetPerformanceDocument method returns the latest profiling results for the agent.