All,
I have the following problem. I want to launch an agent and want it to communicate back to the calling script if things went OK or if something went less OK.
I tried to use a solution that seems obvious, the return value of the NotesAgent.Run
My agent looks like this (Terminate sub routine is empty)
Sub Initialize
Set ws = New NotesUIWorkspace
Set uidoc = ws.Currentdocument
Set doc = uidoc.Document
Set pass = doc.Getfirstitem("Passcode")
Error 1144
' log information here
End Sub
I am calling(or launching if you may) the agent like this
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim agent As NotesAgent
Set db = session.CurrentDatabase
Set agent = db.GetAgent("MyAgent")
returnVal% = agent.Run
Messagebox "It returned " & returnVal%
End Sub
If I take out the Error statement the logs get updated, and that doesn't happen if I leave there the Error statement, so it is definitely causing an error. But the Message box always prints stubbornly "It returned 0". I also tried to put the Error statement on Terminate. Result was the same, unfortunately ..
Could you please kindly point me where I'm going sideways on this ? I was expecting this to be simple.
Thank you
Kind Regards, Carlos