|
: -5 : 0 : 5 |
It only works in conjunction SSJS->LS-agent, and in the security tab is the option "Run as Web user".
1. On Notes Client:
Button code:
Dim ns As New NotesSession
Dim ndb As NotesDatabase
Dim na As NotesAgent
Dim nd As NotesDocument
Set ndb = ns.CurrentDatabase
Set na = ndb.GetAgent("(test)")
Set nd = ndb.CreateDocument
Call na.RunWithDocumentContext(nd)
Code of agent "test":
Dim nd As NotesDocument
Set nd = NotesSession.DocumentContext
Call nd.Replaceitemvalue("test", 1)
MessageBox nd.Getitemvalue("test")(0) 'Not displayed
Call nd.Save(True, True) 'Not saved Does not work.
Errors compiling / execution is not. I even tried to specifically generate an error and write it in log.nsf, but the error is not generated .. it seems that the agent does not start.
2. On Domino Server:
Install the Domino Server 8.5.2 and ODS raised to 51 - does not work :-( If the button code to put in the agent who started using RunOnServer, and from it has already run the agent using RunWithDocumentContext, then when you call the new method is written to the console error "Unable to pass doc context - Caller must run with user authority" (Err = 4795) . Naturally all the rights to run agents are, especially in the properties of agents set the maximum runtime security level, even with the option "Run as Web user" for both agents...
Do please to RunWithDocumentContext worked when run from LotusScript on the Notes Client and the Domino Server.
|