Domino Code Fragment

Code Name*
LastRun property
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.15.197.123
Description*
This example prints the date and time that the agent last ran.
Type*
Java
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
import lotus.notes.*;
import java.util.Vector;


public class lastrunagent extends AgentBase
{
 public void NotesMain()
   {
   try
     {
       Session s = getSession();
       AgentContext ac = s.getAgentContext();
       DateTime date = ac.getLastRun();
       if (date.getDateOnly() == null)
         System.out.println("Agent was not run before");
       else
         System.out.println
         ("Agent was last run on " + date.getDateOnly() +
         " at " + date.getTimeOnly());
     }
   catch (Exception e)
     {
       e.printStackTrace();
     }
   }
}