I have 2 different databases (AA & BB). I am running a script from AA database and calling a agent which is in BB database using RunOnServer [ agent.RunOnServer(NoteID)].
Now from BB database is there any way I can get the handle of the NoteID?.
Let me place the code over here so that you can understand my need better.
Code in BB database agent
set sess= New Notessession
Set db = sess.currentDatabase
Set agent = sess.CurrentAgent
NoteID = agent.ParameterDocID
But if you really see in our case we need to get the handle of the AA database not
CurrentDatabase.
I know if I want I can hard code like this
Set db= sess.GetDatabase(“server”,“AA.nsf”)
But like AA there would many dbs calling the agent which is in BB. So I don’t want to hard code it.
So is there any way I can know from which db the agent was called?
Subject: RE: RunOnServer calling another database agent
No, but why are you calling the agent with the handle of a document in the calling database? Why don’t you use a document in the called-to database to provide your parameters?
Subject: RE: RunOnServer calling another database agent
So create a document in the “Common Process” database that contains information about where to find the document in the calling database – server name, filepath, noteID – and call the agent with that new note.