UNID (NotesCalendarEntry - Java)
Read-only. Universal ID of the underlying document for a calendar notice.
Defined in
NotesCalendarNoticeSyntax
String NotesCalendarNotice.getUNID()
throws NotesException
Examples
This agent displays the Note UNID of an invitation.import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
DbDirectory dbdir = session.getDbDirectory("");
Database maildb = dbdir.openMailDatabase();
NotesCalendar cal = session.getCalendar(maildb);
java.util.Calendar jdt = java.util.Calendar.getInstance();
jdt.set(2012, 1, 1, 1, 1, 1);
DateTime dt1 = session.createDateTime(jdt);
DateTime dt2 = session.createDateTime("Yesterday 02");
java.util.Vector invites = cal.getNewInvitations(dt1, dt2);
Database db = agentContext.getCurrentDatabase();
// Create document to post results
Document doc = db.createDocument();
doc.appendItemValue("Form", "main");
doc.appendItemValue("subject", "Invitation");
RichTextItem body = doc.createRichTextItem("body");
if (invites.size() == 0) body.appendText("No invitation");
else {
NotesCalendarNotice invite = (NotesCalendarNotice)invites.firstElement();
body.appendText("UNID: " + invite.getUNID() + "\n");
body.appendText(invite.read());
}
doc.save(true, true);
} catch(Exception e) {
e.printStackTrace();
}
}
}