UID (NotesCalendarEntry - Java)

Read-only. Globally unique identifier of a calendar entry in iCalendar format.

Defined in



String NotesCalendarEntry.getUID()
	throws NotesException


The UID is generated upon creation of the entry and takes the following form:


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) {