UID (NotesCalendarEntry - LotusScript®)

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

Defined in


Data type



To get: uid$ = notesCalendarEntry.UID


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.
Sub Initialize
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim calview As NotesView
	Dim caldoc As NotesDocument
	Dim unid As String
	Dim cal As NotesCalendar
	Dim cale As NotesCalendarEntry
	Dim s As String
	Dim n As Long
	REM Get calendar for current user
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb)
	REM Get number of calendar entry
	s = InputBox("Enter an integer", "calentry", 1)
	If IsNumeric(s) Then
		n = Clng(s)
		MessageBox "Not numeric: " & s,, "Error"
		Exit sub
	End If
	REM Get calendar entry and post UID to environment variable
	Set calview = maildb.Getview("($Calendar)")
	Set caldoc = calview.Getnthdocument(n)
	If caldoc Is Nothing Then
		MessageBox "Calendar entry out of range",, "Error"
		Exit sub
		unid = caldoc.Universalid
		Set cale = cal.Getentrybyunid(unid)
		Call session.Setenvironmentvar("currentuid", cale.Uid)
	End If
End Sub