I am trying to run this simple script and it errors out on the RunOnServer call with a dialog “Notes Error : Notes Item not found” and thats it .
Sub Click(Source As Button)
Dim ses As New NotesSession
Dim db As NotesDatabase
Dim dagent As NotesAgent
Set db = ses.CurrentDatabase
Set dagent = db.GetAgent("TPRSSFlag)")
Call dagent.RunOnServer()
End Sub
The agent I am trying to run is as follows (with security info changed). Simple 6 lines of @Formula. Agent is Trigger on Event, Agent List , Allow restricted ops
Renaud thanks for your thoughts , but the name is not the problem as this is the way you specify an alias in a “hidden agent” i.e Agent List. I have now re written all ODBC code in Script and run this as scheduled agent, runs fine .
Wrote another agent that did simple Print command on server and tested RunOnServer and worked fine .
Now if I change Print for a call to agent.Run to run the scheduled agent that worked fine, then I get exactly the same error. But the error is generated on the server and not the client.
As you said it runs on a client but not on the server, the problem is probablybecause when you run it on your server the ODBC datasource is not available.
Is your ODBC datasource defined on your server at the OS level as a System DSN ?
Problem fixed found issue. I created both agents as manual agents i.e Trigger from “Agent Menu” and all burst into life. So the Note Item not found related to the agent . The key is when specifying a “hidden agent” i.e with brackets around its name .The syntax has to be Call agent.RunOnServer(" (agentname) ") . Spaces before and after are key. This syntax is shown in @Command(RunAgent)