CreateEntry (NotesCalendar - LotusScript®)

Creates a calendar entry.

Defined in

NotesCalendar

Syntax

Set notesCalendarEntry = notesCalendar.CreateEntry( icalentry$ , [ flags% ] )
Parameter Description
icalentry String. Input for one calendar entry in iCalendar format.
flags Integer. Write flag.
  • CS_WRITE_DISABLE_IMPLICIT_SCHEDULING (2) disables the automatic sending of notices to participants. Setting this flag is the same as setting AutoSendNotices to false before calling this method.
Return value Description
NotesCalendarEntry The calendar entry.
Possible exception (lsxbeerr.lss) Value Text Description
lsERR_NOTES_ERR_ERRSENDINGNOTICES 4809 Error sending notices A problem occurred sending out notices for a meeting. You may want to update the meeting again.
lsERR_NOTES_ERR_ENTRYEXISTS 4815 Entry already exists The entry exists in the calendar.

Usage

An exception occurs if the input is invalid. See Internet Calendaring and Scheduling Core Object Specification (iCalendar) at http://tools.ietf.org/html/rfc5545 for the format, or use the output from a read operation as a template. The examples show basic formatting for an appointment and a meeting.

If problems persist, try running with the following notes.ini variable: CSDebugAPI=1. When the exception occurs, check the console log for details.

For a meeting, if AutoSendNoticesis not set to false and CS_WRITE_DISABLE_IMPLICIT_SCHEDULING is not set, notices are automatically sent to participants.

If icalentry contains a recurrence rule (RRULE item), this method creates a calendar event for each recurrence with its own identifier (RECURRENCE-ID item). The format of a recurrence identifier is the time of the event in UTC format, for example, 20120913T160000Z. However, if you later change the time of the event, the identifier does not change.

Examples

This agent creates a meeting calendar entry for today and tomorrow at 1600 UTC, with no notices being sent, and posts its UID and the first recurrence identifier to sessionScope variables.
Sub Initialize
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim cal As NotesCalendar
	Dim calentry As NotesCalendarEntry
	Dim icale As String
	Dim tday As String
	REM Get calendar for current user and create entry
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb)
	tday = Format(Today, "yyyymmdd")
	icale = |BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:| & tday & |T160000Z
DTEND:| & tday & |T170000Z
RRULE:FREQ=DAILY;COUNT=2
ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED;CN="Roberta Person/Westford/IBM";
 RSVP=FALSE:mailto:roberta_person@us.ibm.com
ATTENDEE;ROLE=REQ-PARTICIPANT
 ;CN="Doc Test/Bedford/IBM";RSVP=TRUE:mailto:doctest@us.ibm.com
SUMMARY:Sample Meeting
ORGANIZER;CN="Roberta Person/Westford/IBM"
 :mailto:roberta_person@us.ibm.com
END:VEVENT
END:VCALENDAR|
	Set calentry = cal.Createentry(icale, Cs_write_disable_implicit_scheduling)
	Call session.Setenvironmentvar("currentuid", calentry.Uid)
	Call session.Setenvironmentvar("currentrecurid", tday & "T160000")
	MessageBox "UID = " & calentry.Uid,, "Created calendar entry"
End Sub