import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext =
session.getAgentContext();
// (Your code goes here)
Log log = session.createLog("Overwrite file");
log.setOverwriteFile(true);
log.openFileLog("over.log");
log.logAction("Logged an action");
} catch(Exception e) {
e.printStackTrace();
}
}
}
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext =
session.getAgentContext();
// (Your code goes here)
Log log = session.createLog("Overwrite file");
DateTime lastRun = agentContext.getLastRun();
DateTime nowDateTime = session.createDateTime("Today");
nowDateTime.setNow();
int daysSinceRun =
nowDateTime.timeDifference(lastRun) / 86400;
if (daysSinceRun > 7)
log.setOverwriteFile(true);
else
log.setOverwriteFile(false);
log.openFileLog("over.log");
log.logAction("Logged an action");
} catch(Exception e) {
e.printStackTrace();
}
}
}