This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.



Oct 23, 2013, 5:23 AM
261 Posts

1 field and a button

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 9.0
  • Role: Developer
  • Tags:
  • Replies: 2

Hi,

Add a field to your XPage and a button. Mark the field as required. By default if you click a button, all fields will be validated first, so on the field's onclick event, you can directly add the code to run the agent ( session.getAgent("nameOfAgent").run() ) and save the document ( doc.save() ). 

If you need to pass parameters to the agent, use the .runWithDocumentContext() method.

I made some assumptions in my answer, so you might to tweak it for your situation.

Mark


This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.