UNID (NotesCalendarEntry - JavaScript)

Read-only. Universal ID of the underlying document for a calendar notice.

Defined in

NotesCalendarNotice

Syntax

getUNID() : string

Examples

This button event displays the UNID of an invitation.
var dbdir:NotesDbDirectory = session.getDbDirectory("");
var maildb:NotesDatabase = dbdir.openMailDatabase();
var cal:NotesCalendar = session.getCalendar(maildb);
var jdt:java.util.Calendar = new java.util.Calendar.getInstance();
jdt.set(2012, 1, 1, 1, 1, 1);
var dt1:NotesDateTime = session.createDateTime(jdt);
var dt2:NotesDateTime = session.createDateTime("Yesterday 02");
var invites:java.util.Vector = cal.getNewInvitations(dt1, dt2);
if (invites.size() > 0) {
	var invite:NotesCalendarNotice = invites.firstElement();
	requestScope.status = "Invitation\n";
	requestScope.status = requestScope.status + "UNID: " + invite.getUNID() + "\n";
	requestScope.status = requestScope.status + invite.read();
} else {
	requestScope.status = "No invitation\n";
}

LotusScript® syntax and examples

NotesCalendarNotice.Accept(Byval comments As String)
This agent displays the Note UNID of an invitation.
Sub Initialize
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim cal As NotesCalendar
	Dim dt1 As NotesDateTime
	Dim dt2 As NotesDateTime
	Dim invites As Variant
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb)
	Set dt1 = session.createdatetime("01/01/2012 00:00 AM")
	Set dt2 = session.createdatetime("Yesterday 00:00 AM")
	invites = cal.Getnewinvitations(dt1, dt2)
	If IsEmpty(invites) Then
		MessageBox "No invitation",, "Nothing"
	Else
		Dim invite As NotesCalendarNotice
		Set invite = invites(0)
		MessageBox invite.Read(),, "UNID: " & invite.Unid
	End If
End Sub

Java syntax and examples

void NotesCalendarNotice.accept(String comments)
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();
      }
   }
}