How to run agent in iNotes 8.5.1?

How do I have to customize an agent in iNotes 8.5.1?

What did I do until now?

I copied the Forms85.nsf to MyForms85.nsf for own agents and so on. In my used mailbox I changed the FormsTemplateFile entry in the icon resource to ‘MyForms85.nsf’.

I created a Forms85_x.nsf and customized the subform Custom_JS_Lite to get my own additional menu items.

I already created a simple agent (MyAgent), only to put an info text to the server console. This agent is saved in MyForms85.nsf.

In the function Custom_Scene_PostLoad_Lite (in Forms85_x.nsf) I called the agent with a command string like this

var sAgentName = “MyAgent”;

var sCmd = ‘iNotes/MyForms85.nsf/iNotes/Proxy/?EditDocument&Form=s_RunAgent&PresetFields=AgentName;’ + sAgentName;

My problem is that this simple agent is never executed although this command should be called and there is no error message.

Can any one help?

Best regards,

Heike

Subject: Some things to try

That URL to run the agent should work. Check to make sure you have rights to run an agent in the Forms85 file. Also check the checkbox on the 2nd tab of the agent properties dialog is set to “Run as Web User”.

In the agent:

MessageBox statements will write text to the server console

Print statements will write text to be returned to the browser

Are you sure your Custom_Scene_PostLoad_Lite code is being called? You may want to put an “alert” statement there just to be sure. If the form being used is the mail edit form, then your code should be in Custom_JS, not Custom_JS_Lite. For mail read, the right subform is Custom_JS_Lite.

Subject: Formula agents do not run

I solved this problem meanwhile and the agents work fine. But now I created a Formula agent, my only statement is a @Prompt statement. It doesn’t work. Is there a different to agents in LotusScript?

Regards,

Heike

Subject: @Prompt does not work via the web

The @Prompt function does not work with web applications. I’m not sure if there is a formula language function that writes to the server console. If you just want to test the agent, I suggest you use LotusScript and the MessageBox function.

Subject: doesnt work for me!!

Sorry Eric if i resume this discussion

I’m looking for a way to feedback a pop-up or a message from an agent to the inotes user,

you said:

MessageBox statements will write text to the server console

Print statements will write text to be returned to the browser

The first is right: but the user can’t have the access to the server console

The second is not copletely true, it write output to the inotes console, and many users will miss the feedback!!

Is there some way to achieve this?

Subject: Tutorial / Code-examples…?

Excuse my question here…but where can I find a tutorial or code-examples for the use of agents in iNotes?

I found this page

http://www-10.lotus.com/ldd/dominowiki.nsf/dx/Running_an_agent

but I don’t know how to apply this.

I want to call an agent (placed in MyForms85.nsf) from an action (placed in Forms85_x.nsf).

The action works with test-code (‘alert(…’).

Where to place

“<NotesVar name=varname value={@DbCommand(“haiku”;“h_RunAgent”;“name”;“loc”)}>”

I don’t know.

“@{@DbCommand(“haiku”;“h_RunAgent”;“name”;“loc”)}” (complete action is ignored) or

@DbCommand(“haiku”;“h_RunAgent”;“name”;“loc”)” (generating error)

doesn’t work in my action (custom_js_lite).

How to invoke

“iNotes/Forms85.nsf/iNotes/Proxy/?EditDocument&Form=s_RunAgent&PresetFields=AgentName;name”

I don’t know.

Where can I find the infos?

Nicolas