I am having trouble with a runonserver agent not failing when it should, so I created a simple test db with an agent and a form with an action to run the test agent. I tested it and can see the error on the server console but am unable to get anything other than success from runonserver.
Below is the test setup. Any idea why result is 0?
The called agent did not run to completion due to the error so I would expect to see something other than 0 for a result. Using “run” instead of “runonserver” has the same effect (result=0, no error returned)
Agent:
Sub Initialize
Dim x As Integer
Dim y As Integer
x=1/y 'divide by zero error
End Sub
'*********************************
Action in form:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim theagent As NotesAgent
Dim db As notesdatabase
Dim result As Integer
Set db=session.CurrentDatabase
Set theagent=db.GetAgent("Cause Error")
result=theagent.RunOnServer
'result is 0, even with error
End Sub