There are different ways you can call Lotus Script and Java code from Javascript in domino. But there are predefined few conditions to make the calls.
Pre-condition
1. The called code must be written in an Agent. (Note: the agent can inturn call a function from script library or java class)
2. In the agent Runtime section, the Target documents must be None
3. The logged in web user must have access to execute the agent or the agent signer must have the access.
Different methods to execution.
1. Javascript can call a URL like <AgentName>?OpenAgent and agent can return the url back to the HTTP_REFERER
2. Javascript can click on a button - document.forms[0].<buttonname>.click() and the button inturn can call the agent using
@command(Toolsrunmacro)
3.Javascript can submit the form using document.forms[0].submit and on the form web query save event an agent can be triggered.
4. Once can use AJAX Methods also to called a Lotus script / Java agent.
Final notes
Note in all of above methods one has to take care about returning the Page back to the browser. we can use
1. print the url in the agent to return
2. use $$Return field to return
3. if a button is clicked on the form then agent or form does not require return url.
4. If one is using Ajax the no return url is required.
Pre-condition
1. The called code must be written in an Agent. (Note: the agent can inturn call a function from script library or java class)
2. In the agent Runtime section, the Target documents must be None
3. The logged in web user must have access to execute the agent or the agent signer must have the access.
Different methods to execution.
1. Javascript can call a URL like <AgentName>?OpenAgent and agent can return the url back to the HTTP_REFERER
2. Javascript can click on a button - document.forms[0].<buttonname>.click() and the button inturn can call the agent using
@command(Toolsrunmacro)
3.Javascript can submit the form using document.forms[0].submit and on the form web query save event an agent can be triggered.
4. Once can use AJAX Methods also to called a Lotus script / Java agent.
Final notes
Note in all of above methods one has to take care about returning the Page back to the browser. we can use
1. print the url in the agent to return
2. use $$Return field to return
3. if a button is clicked on the form then agent or form does not require return url.
4. If one is using Ajax the no return url is required.