running an agent from a different database

Hi, I need to run an agent of a database from another database.

I mean, In database A i've a button in one of its view and when it is clicked, it should run an agent from database B.

Lets say I've an agent in Database B. The normal formula to run this is
@Command([ToolsRunMacro];"(agent)")

But I want to run this agent by clicking a button in Database A.

thanks
sri
sridevi911Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kaliosConnect With a Mentor Commented:
You have to code it like this

Set otherDB = New NotesDatabase(otherdbserver, otherdbpath).


This should work fine.

Kalios
0
 
Bozzie4Connect With a Mentor Commented:
You can't in Formula, but you can using script .  Put this in your Lotusscript - button area.

Dim s As New NotesSession
  Dim db As NotesDatabase
dim otherdb as notesdatabase
  Dim agent As NotesAgent
  Set db = s.CurrentDatabase
set otherdb = s.getdatabase( db.server , "OTHERDB.NSF" )
  Set agent = otherdb.GetAgent("(agent)")
  If agent.Run = 0 Then
    Messagebox "Agent ran",, "Success"
  Else
    Messagebox "Agent did not run",, "Failure"
  End If
0
 
Andrea ErcolinoCommented:
in Notes 6:

@Command( [FileOpenDatabase]; server : database );
@UpdateFormulaContext;
@Command( [RunAgent]; AgentName );
@Command([CloseWindow])
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
sridevi911Author Commented:
bozzie,

I get an error at the following :

Set otherdb = s.getdatabase( db.APPS01/SIVX , "apps2/cust.nsf" )

how do i specify the server part?


Raputa,
There are many users who have R5. so if the above only works on R6 then it would be a problem

thanks
0
 
Andrea ErcolinoCommented:
Yes, my solution works only for at least Notes 6...
Then you should do as Bozzie4 said.
0
 
sridevi911Author Commented:
kalios.. works fine. thanks
0
All Courses

From novice to tech pro — start learning today.