1
votes

I am receiving an error when trying to call an agent from an xpages button click: Error below

Error while executing JavaScript action expression Script interpreter error, line=2, col=7: [TypeError] Exception occurred calling method NotesAgent.runWithDocumentContext(lotus.domino.local.Document) null

JavaScript code

var agent=database.getAgent("xpCreateNewCopy");
agent.runWithDocumentContext(currentDocument.getDocument());
1
And agent and currentDocument.getDocument() both have value (are not null)? If I recall correctly I once noticed the same, runWithDocumentContext did not work from SSJS (don't remember the Domino version).Panu Haaramo
What version of Notes/Domino? runWithDocumentContext requires 8.5.2+Per Henrik Lausten
8.5.3. It returns the same error regardless of agent.run or .runwithcontextJim M

1 Answers

5
votes

I had missed an important setting, run as web user. Problem solved.