I am having problems triggering a lotusscript agent from a button on an xpage.
The code is placed in the onclick event of a button (Server) and looks like this:
var db:NotesDatabase = session.getDatabase(session.getServerName(), “web\modules\Product.nsf”);
var agent:NotesAgent = db.getAgent(“(updateProduct)”);
agent.runOnServer(document1.getDocument().getNoteID());
The agent will not run when I click the button. If I put the exact same code in an inputtext field (just for debugging purposes) and refresh the web page (xpage), the agent is run properly.
Same code for input field:
<xp:inputText id=“inputtext1”>xp:this.value<![CDATA[#{javascript:
var db:NotesDatabase = session.getDatabase(session.getServerName(), “web\modules\Product.nsf”);
var agent:NotesAgent = db.getAgent(“(updateProduct)”);
agent.runOnServer(document1.getDocument().getNoteID());
}]]></xp:this.value></xp:inputText>
What am I doing wrong here? I also tried using a submit-button with no luck.