Hello,In an application designed for Web if I need to call a server side agent using Javascript is that possible? If yes, then how.
Actually while designing for the web I’m not willing to call the agent from WebQuerySave/WebQueryOpen but against a button where there could be some Javascript code through which that agent could be called.
Thanks.
Subject: How To Call ServerSide Agent Using Javascript
Create a button named “Button1” and write the formula languge for executing the agent.@Commnad ([ToolsRunMacro];)
Hide this button from the user and create another button named “Button2”. Button2 will be visible to the user and they will click on this button. In this button you can call the click of Button1 via JavaScript.
window.document.forms[0].<>(Button1);
This will be sufficient for you to execute the agent.
Regards,
Kaushal.
Subject: RE: How To Call ServerSide Agent Using Javascript
Sorry for wrong JavaScript syntaxwindow.document.forms[0].Button1.click();
This will be right syntax you need to write on Button2
Subject: RE: How To Call ServerSide Agent Using Javascript
Thanks Kash,
But this is not working.
Because when I am hiding the other button from web and clicking on the other button a “Error on Page is shown” which says that the hidden button does not exist or is null object.
BUT if I unhide that button then this code works.
Now question is that how can I execute the code without error if I hide the first button.
Subject: RE: How To Call ServerSide Agent Using Javascript
Dont hide the button from the Hidenwhen tab of the button property.Hide the button by writing display:none; in the Style of the HTML tag of buton property.
I am sure this wil work!
regards,
Kaushal
Subject: RE: How To Call ServerSide Agent Using Javascript
Thanks Kash
Thanks a Lot.
This time it worked fine.
Thanks
Subject: How To Call ServerSide Agent Using Javascript
Hello Sudip,
To call an agent using javascript, you need to use URL commands.
Try changing the url to something whcih looks like,
http://domain.com/db.nsf/your_Agent_Name_here?OpenAgent
This will fire the agent.
Hope this helps.
Best Regards,
Munish Kaushik
Subject: How To Call ServerSide Agent Using Javascript
Call LotusScript agent via Javascript/AJAX: