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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bozzie4IT ArchitectCommented:
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
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
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Andrea ErcolinoCommented:
Yes, my solution works only for at least Notes 6...
Then you should do as Bozzie4 said.
0
kaliosCommented:
You have to code it like this

Set otherDB = New NotesDatabase(otherdbserver, otherdbpath).


This should work fine.

Kalios
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sridevi911Author Commented:
kalios.. works fine. thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.