Domino Code Fragment

Code Name*
Rules for Creating LotusScript Agents that Execute from a Web Browser
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.117.111.1
Description*
Below are a list of items to keep in mind while creating LotusScript agents that will be executed from a web browser.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Problem:
What do you need to know before you write LotusScript agents that web browsers will execute on a Domino
server?

Solution:
Below are a list of items to keep in mind while creating LotusScript agents that will be executed from a web
browser.

General Information

1. A web browser can execute a LotusScript agent in the following three ways:

- From the $$QueryOpenAgent field
- From the $$QuerySaveAgent field
- Using the ?OpenAgent Domino command

2. While Java scripts are executed on individual web user's browsers, LotusScript agents are processed on the
Domino server. This means that when a web browser attempts to execute a LotusScript agent on a Domino
server, the agent gets added to the server's agent queue and, only after the agent request has passed through
the queue and executed, will the user be able to continue browsing the Domino web site. Because of this, it is
important to keep LotusScript agents small so that they can be processed quickly.

3. The NotesDatabase UnprocessedDocuments property will not return a document handle.

4. In order to access the current document, use the DocumentContext property of a NotesSession object.

5. Front end classes may not be used.

6. All Domino LotusScript agents must be set to "Run Once" with a trigger option of "Manually from the
actions menu."

$$QueryOpenAgent specifics

1. These agents run before the document is loaded.
2. They can write to fields from a new document.
3. They cannot read field values from a new document.
4. Output functions (such as the Print command) are ignored.

$$QuerySaveAgent specifics

1. These agents run after the document has been saved.
2. They cannot write to fields from a new document.
3. They can read field values from a new document.
4. Output functions will display in a new output window on the web browser.

$$OpenAgent specifics

1. These agents can be called from anywhere that you can enter a URL (for example, from a hotspot).
2. They cannot read field values from a new document.
3. Output functions will display in a new output window on the web browser.