0

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 2

1

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…

Sign up to request clarification or add additional context in comments.

3 Comments

Its not XPages. Its a web based application designed using Javascript. The script library is in JavaScript. The alternative that you mentioned regarding sending an email, I am not clear on this. Do you mean, I should be asking other application to do the update that I am looking for ?
So what you want is: a way to execute some JavaScript code in the browser, triggered by a LotusScript agent? How is the agent started? Scheduled or using a URL? I'm confused, I don't understand the architecture of your application, where the agent comes in, where the JS runs and how the other application should perform some function... Can you clarify your question?
In your agent, you can return a response (using Print statement) and handle that response after an asynchronous call in your front-end javascript.
0

A JavaScript library within the HCL Domino Designer

Domino Designer JS Library screenshot

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.