I have a LotusScript Agent that will import a CSV file and update one field value for thousands of documents. Once the field is updated and document is saved, I want to call a JavaScript script library function that in turn calls an API and perform some function in another application. How can I call a JavaScript script library function from LotusScript Agent ?
2 Answers
JavaScript? I assume Server-Side JavaScript, in XPages. The only way to “call” such a function is using a URL to an XPage or XAgent that runs the library function.
Or did you have something else in mind?
An alternative would be to send the other application an e-mail…
3 Comments
A JavaScript library within the HCL Domino Designer
allows you to store JavaScript classes, functions, and variables for common use within a HCL Domino XPages application. A HCL Domino JavaScript library is either a XPages client library or a XPages server library.
Within an XPage you would call that function, for example inside a button, like this:
<xp:button value="create" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:import JSDemoLib;
demoprint("Hello World!")}]]></xp:this.action>
</xp:eventHandler>
You can't call/import a HCL Domino Designer JavaScript Library from within a LotusScript agent directly. That is only possible for LotusScript libraries. Your agent would have to do a http request to a Domino server running a XPage application using the JavaScript library in question in order to execute the code contained within the JavaScript library.
