Domino Code Fragment

Code Name*
Parent property
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.14.15.94
Description*
This example prints the name of the database on which the agent is running.
Type*
Java
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
import lotus.notes.*;


public class parentagent extends AgentBase
{
 public void NotesMain()
   {
   try
     {
       Session s = getSession();
       AgentContext ac = s.getAgentContext();
       Agent agent = ac.getCurrentAgent();
       Database db = agent.getParent();
       System.out.println
       ("Database on which this agent is running is '" +
       db.getTitle() + "'");
     }
   catch (Exception e)
     {
       e.printStackTrace();
     }
   }
}