LOTUSSCRIPT/COM/OLE CLASSES


Accessing agents
Example

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:
PropertyData typeDescription
CommentString(Read-only) Comment entered by agent designer
CommonOwnerString(Read-only) Common name of the user who last modified the agent
HasRunSinceModifiedBoolean(Read-only) True if the agent has run since it was created or last modified
HttpURLString(Read-only) The HTTP URL of an agent.
IsActivatableBoolean(Read-only) True if user activation is in effect when enabling an agent.
IsEnabledBoolean(Read-write) True if the agent can run.
IsNotesAgentBoolean(Read-only) True if the agent can run in the Domino client environment
IsPublicBoolean(Read-only) True if the agent is public
IsWebAgent Boolean(Read-only) True if the agent can run in a Web browser environment
LastRunDate variant(Read-only) Date that the agent last ran
NameString(Read-only) Name of the agent
NotesURLString(Read-only) The Notes URL of an agent.
OnBehalfOfString(Read-only) Name of user under whose identity a scheduled or Web agent runs.
OwnerString(Read-only) Name of the creator of the agent
ParameterDocIDString(Read-only) The note ID of a document
ParentNotesDatabase(Read-only) Database that contains the agent
QueryString(Read-only) Query used by the agent to select documents
ServerNameString(Read-write) Name of the server on which the agent runs
Target Boolean or Constant(Read-only) Indicates which documents the agent acts on
Trigger Boolean or Constant(Read-only) Indicates when the agent runs
If you write a script that changes a read-write property, you must call the Save method to make the change effective.
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.

Example
See Also