getNoticeByUNID (NotesCalendar - Java)

Gets a calendar notice given its universal identifier (UNID).

Defined in

NotesCalendar

Syntax

NotesCalendarNotice NotesCalendar.getNoticeByUNID(String unid)
	throws NotesException
Parameter Description
unid The universal identifier (UNID) of the Domino® document containing the notice.
Return value Description
NotesCalendarEntry The calendar notice. An exception occurs if the identifier is invalid.

Examples

This agent gets a notice whose UNID is posted 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 notice");
          RichTextItem body = doc.createRichTextItem("body");
          // Get notice and put in body of document
          String unid = session.getEnvironmentString("noticeunid");
          NotesCalendar cal = session.getCalendar(maildb);
          body.appendText("Calendar notice for UNID " + unid + "\n");
          body.appendText(cal.getNoticeByUNID(unid).read());
          doc.save(true, true);

      } catch(Exception e) {
          e.printStackTrace();
       }
   }
}