Running an agent using Lotus Script

I need code for running an agent using Lotus Script for Notes 5 and 6.I’ve tried the help file but I only get the formula language command

Thanks.

Subject: Running an agent using Lotus Script

See Designer help : NotesAgent class

Subject: RE: Running an agent using Lotus Script

Thanks.I’m trying to run the agent in the QuerySave event using Lotus Script.I’ve tried using agent.Run method but I get an error message when I save the document.Is another code that I could use?

Subject: RE: Running an agent using Lotus Script

You can run an agent in this context, though in general I would suggest not using an agent here unless you really have to. Just put the code in the form (or, if you are reusing the code elsewhere, a script library that you “Use” in the form).

Without knowing what your source code is, what the agent does, or what error you are getting, there is little I can suggest. However, I think most likely your agent is saving the document using the NotesDocument.Save method, resulting in a save conflict when you try to save a second time. The answer is to not save your changes in the agent.