Solved

running an agent from a different database

Posted on 2004-10-27
1,426 Views
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
@Command([ToolsRunMacro];"(agent)")

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

thanks
sri
0
Question by:sridevi911
    6 Comments
     
    LVL 15

    Assisted Solution

    by:Bozzie4
    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
     
    LVL 3

    Expert Comment

    by:Andrea Ercolino
    in Notes 6:

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

    Author Comment

    by:sridevi911
    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
     
    LVL 3

    Expert Comment

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

    Accepted Solution

    by:
    You have to code it like this

    Set otherDB = New NotesDatabase(otherdbserver, otherdbpath).


    This should work fine.

    Kalios
    0
     

    Author Comment

    by:sridevi911
    kalios.. works fine. thanks
    0

    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