import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
DocumentCollection dc = db.getAllDocuments();
Document doc = dc.getFirstDocument();
while (doc != null) {
Vector v = session.evaluate("@ProperCase(Subject)", doc);
doc.replaceItemValue("Subject", v.firstElement());
doc.save(true, false);
doc = dc.getNextDocument();
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
DocumentCollection dc = db.getAllDocuments();
System.out.println("Count = " + dc.getCount());
Document doc = dc.getFirstDocument();
while (doc != null) {
if (doc.getItemValueInteger("Amount") != 0) {
Vector v = session.evaluate("@Sum(Amount)", doc);
System.out.println(v.firstElement() + " " +
doc.getItemValueString("Subject"));
}
doc = dc.getNextDocument();
}
} catch(NotesException ne) {
System.out.println(ne.id + " " + ne.text);
} catch(Exception e) {
e.printStackTrace();
}
}
}