1
votes

There are many ways to run legacy LS code on an xpages, including the new webquerysaveagent property against a datasource in 8.5.3. But I am not sure how I can run an agent as signer (so the run as web user is unticked) without re-writing the whole code in SSJS. Has anyone figured out how this can be achieved?

Thanks for all your help in advance.

1

1 Answers

4
votes

You can do this with sessionAsSigner - method:

sessionAsSigner.getCurrentDatabase().getAgent("RunAsSigner").run()

The option "Run as webuser" has to be disabled.

To run with the datasource you have to use the corresponding NotesDocument:

sessionAsSigner.getCurrentDatabase().getAgent("RunAsSigner").runWithDocumentContext(document1.getDocument())