UID (NotesCalendarEntry - Java)
Read-only. Globally unique identifier of a calendar entry
in iCalendar
format.
Defined in
NotesCalendarEntrySyntax
String NotesCalendarEntry.getUID()
throws NotesException
Usage
The UID is generated upon creation of the entry and takes the following form:UID:F0A3694E4E7E20938525790F004D370A-Lotus_Notes_Generated
Examples
This agent gets a calendar entry using the UNID for a document from the($Calendar)
view
in the mail database of the current user, and posts its UID to an
environment variable.import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Integer n = (Integer)session.getEnvironmentValue("calentry");
DbDirectory dbdir = session.getDbDirectory("");
Database maildb = dbdir.openMailDatabase();
View calview = maildb.getView("($Calendar)");
Document caldoc = calview.getNthDocument(n.intValue());
if (caldoc == null) return;
String unid = caldoc.getUniversalID();
NotesCalendar cal = session.getCalendar(maildb);
NotesCalendarEntry cale = cal.getEntryByUNID(unid);
session.setEnvironmentVar("currentuid", cale.getUID());
} catch(Exception e) {
e.printStackTrace();
}
}
}