getEntry (NotesCalendar - Java)

Gets a calendar entry.

Defined in



NotesCalendarEntry NotesCalendar.getEntry(String uid)
	throws NotesException
Parameter Description
uid The iCalendar identifier (UID item) of the entry.
Return value Description
NotesCalendarEntry The calendar entry. No exception occurs for this method if the identifier is invalid. However, when you attempt to use the returned NotesCalendarEntry object, the following exception occurs: Entry not found in index.


This method does not verify uid except for its existence. Validity checking and error reporting occur when you attempt to use the returned NotesCalendarEntry object.


This agent gets the calendar entry for a UID saved as 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)
          DbDirectory dbdir = session.getDbDirectory("");
          Database maildb = dbdir.openMailDatabase();
          // Create document to post results
          Database db = agentContext.getCurrentDatabase();
          Document doc = db.createDocument();
          doc.appendItemValue("Form", "main");
          doc.appendItemValue("subject", "Calendar entry");
          RichTextItem body = doc.createRichTextItem("body");
          // Get entry and put in body of document
          String uid = session.getEnvironmentString("currentuid");
          if (uid != null) {
              NotesCalendar cal = session.getCalendar(maildb);
              body.appendText("Calendar entry for UID " + uid + "\n");
          } else {
        	  body.appendText("Current UID not set");
, true);

      } catch(Exception e) {