I am trying to run two agents on server from a button what I do is use this code and change agent names
Sub Click(Source As Button)
Dim db As notesdatabase
Dim session As notessession
Set Session = New NotesSession
Set db = session.currentdatabase
Dim Agent As NotesAgent
'Set Agent = db.GetAgent("Retrieve OPS Details Data")
Set Agent = db.GetAgent("trial like human resource")
Call uidoc.save
Call Agent.RunOnServer(doc.NoteID)
End Sub
first agent runs perfectly the second agent gives me an error “Unknown LotusScript Error”
That error usually occurs when one runs agent code programmatically that contains UI elements / functionality. This can’t be done, because NotesAgent.Run() is a back-end operation.
thanks again for your feedback when I checked my log I found this
error: Instance member DOCUMENTCONTEXT does not exist
as I am trying to declare the current document that the agent run from,so what is the solution in this case ,as I need to use values from the current document and I need the agent to run on server as well
when I tried session.unprocesseddocument I had the same error
You’re running this on the server. The server doesn’t have access to your workstation environment to know which is the current document that you have open. You’ve made a good start by supplying the document note ID as an argument to RunOnServer, but the server agent doesn’t automatically look up the document – you have to program that. Read about ParameterDocID in the Domino Designer help.