Examples: getNth method
This agent gets the top-level entry specified by the agent comment.
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
View view = db.getView("By Category");
view.setAutoUpdate(false);
ViewNavigator nav = view.createViewNav();
String comment = agentContext.getCurrentAgent().getComment();
if (comment.equals("")) comment = "1";
Integer N = new Integer(comment);
ViewEntry entry = nav.getNth(N.intValue());
if (entry != null) {
System.out.println(entry.getColumnValues().elementAt(0)); }
} catch(Exception e) {
e.printStackTrace();
}
}
}