Sep 1, 2011, 4:03 PM
3 Posts

Can you pass values to an agent from a button?

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: agent
  • Replies: 3
 
 
Hello,
 
Can you pass values to an agent from a button?  In the past I have passed values via url to agent.
Is there a way to pass some values using ssjs?
 
 
 Thanks,
 
Kev
 
 
 
Sep 1, 2011, 4:40 PM
298 Posts
sure
You can still call your agent via a url with parameters and build the url programtically (see the link control). Or, you could have SSJS that got the NotesAgent class for that agent and then pass in a documentContext (8.5.2 only). Note that for the second option the agent has to be set as "Run as web user" for the agent to run and not throw an error. Hoping they fix this in 8.5.3... Howard
Sep 1, 2011, 5:47 PM
272 Posts
Re: Can you pass values to an agent from a button?
...and last but not least you can use a profile document or a normal document [with Agent.run(noteid)].
 
Sven
Sep 1, 2011, 6:30 PM
64 Posts
AJAX is the cleanest method, imho...
- XPages include dojo, which has dojo.xhrGet() & .xhrPost() to invoke a GET or a POST using AJAX.  They're quite simple to use, very repeatable, and work with any version of Domino out of the box.  LotusScript will require some extra code to get the values from JSON, but there are libraries on the 'net for that.  Google and enjoy.
 
Hope this helps...