In the past I could call an agent from the page and get a return result. I had a JS library that would do an ajax call "xmlHttp = new XMLHttpRequest()", which would call an agent, and then the domino agent would return a result, allowing my js library to process the result.
Is this possible in Volt? Is there a better way to call an agent and return a result now? Where I could then take the result and do something on the page based on it? If so, how would that be done?
Thank you for your help.
Hi Tim,
In Volt 1.0.3 they added Domino Services that allow us to access data from a Domino Database. 2 of the services are to read data from a Notes Document as well as run an agent. This is talked about in more detail here: https://help.hcltechsw.com/domino_volt/1.0.3/direct_access_domino_data.html
We see there that calling an agent via a service does not return data but we can pass a UNID as part of the agent service. What we could do here is call a service to run the agent and pass the UNID of a document. Have the agent do its work and update that document and then use another Service call to read the data from the document that the agent updated.
In addition here is a link to a video demonstrating calling an agent via a service.
https://www.youtube.com/watch?v=OwshafFy9MA
Paul Albright
Technical Team Lead - Application Development Team
Notes/Domino/HEI/Volt
Customer Support
Great. This ties into another question I have out there that no one has been able to answer yet. If I take your recommendation and save data to a "working document", how do I reference that working document? Only by UNID? How about if I were wanting to reference data from a particular document, but not sure of the UNID of it? In the old days I'd create a specific view for a specific form, say a "workflow" form and create only one "workflow" document. Then I'd reference values from it. How would I go about finding and referencing a document with a specific form name? There will be only one, I just can't seem to find out how that can be done. Thoughts?
Thank you.
You could use the following services sequence to solve this
1) you create a document in the Notes DB, and the service gives ou back the UNID of the created Notes document.
2) you run the agent, giving it the UNID of the created document and the agent puts whatever values you need into this document
3) you then call up the service to read a specific document (you've got the UNID) and get the values you wanted.
This is just a successive use of standard services and ought to work.
You'd need to create an ID field where the created ID has to be stored. As soon as you need to start the procedure run the document creation service (1), it then gets the value. In onItemChange, you then run the agent (2) followed by the service to call up the created document (3) and et the values you need.
Hope this is understandable and helps.
You say the service gives back a value? I thought it only accepted a value. How is that done?
How would you then use a service to read a document and return a value?
Is there any practical example I can follow on how I'd call a "service" from a page that would read and return values from a document?
Thank you.
In the Output section of the service to create a document, you can map the UNID of the created document to a field
In the onItemChange event of the field 'receiving' the UNID of the created document, you can call up a service - in my case it was to run an agent
But it could be a service to read a document based on the UNID and populate some fields.
I hope this helps ? Feel free to ask for more details.
Christophe