How can I force an agent to run on the server?

I am calling an agent using @Command([ToolsRunMacro];“(agent name)”);

This runs the agent on the client.

Is there a way to force the agent to run on the server?

I believe I cannot use the LotusScript method ‘notesAgent.RunOnServer’, because I want the agent to run on selected Documents (not on all documents).

I guess my question is:

Is there a way to force an agent that is triggered by an event and runs on selected documents to run on the server?

Thanks.

Suz

Subject: RE: How can I force an agent to run on the server?

You will have to use RunOnServer. Of course, a server agent doesn’t have access to your client UI, so it can’t tell which documents are selected. If there information the agent needs to do its job, you will have to package up that information and ship it to the agent in a parameter document. In this case, you could write the note IDs of the selected documents into a multivalue field in the parameter document (if there might be many, you could make it a rich text field or use the IsSummary property to allow the field to contain lots of data).

Subject: How can I force an agent to run on the server?

You will need to use RunOnServer method and figure out how to communicate the information you need to client to server. Agent FAQ has an article about RunOnServer and passing parameters that you might find helpful.