running an agent from a different database

Posted on 2004-10-27
Last Modified: 2013-12-18
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

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

Question by:sridevi911
    LVL 15

    Assisted Solution

    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"
        Messagebox "Agent did not run",, "Failure"
      End If
    LVL 3

    Expert Comment

    by:Andrea Ercolino
    in Notes 6:

    @Command( [FileOpenDatabase]; server : database );
    @Command( [RunAgent]; AgentName );

    Author Comment


    I get an error at the following :

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

    how do i specify the server part?

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

    LVL 3

    Expert Comment

    by:Andrea Ercolino
    Yes, my solution works only for at least Notes 6...
    Then you should do as Bozzie4 said.
    LVL 2

    Accepted Solution

    You have to code it like this

    Set otherDB = New NotesDatabase(otherdbserver, otherdbpath).

    This should work fine.


    Author Comment

    kalios.. works fine. thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
    Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now