Domino Code Fragment
Code Name* LastRun property | Date* 06/28/2025 | Source (or email address if you prefer)* [email protected] IP address:.172.71.254.234 | |
Description* This example prints the date and time that the agent last ran. | Type* Java | Categories* (Misc) |
Implementation: | Required Client: | Server: |
Limitations: | Comments: |
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();
}
}
}