update (NotesCalendarEntry - JavaScript)

Updates a calendar entry.

Defined in

NotesCalendarEntry

Syntax

update(entry:string) : void

update(entry:string, comments:string) : void

update(entry:string, comments:string, flags:long) : void

update(entry:string, comments:string, flags:long, recurid:string) : void

Parameter Description
icalentry The new value of the entry in iCalendar format.
comments Comments regarding a meeting change.
flags Write flags. Combine values by adding them.
  • NotesCalendar.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.
  • NotesCalendar.CS_WRITE_MODIFY_LITERAL (1 completely overwrites the original entry and using only the icalentry input. By default, the update preserves body attachments if they are not supplied with the input and preserves custom fields not present on the icalentry input.
recurid The recurrence identifier (RECURRENCE-ID item) for a recurring calendar event. The format of a recurrence identifier is a time in UTC format, for example, 20120913T160000Z.
Possible exception Value Text Description
NotesError.NOTES_ERR_RECURID_NOTFOUND 4808 Recurrence-ID not found The recurrence identifier for the NotesCalendarEntry object is not valid.
NotesError.NOTES_ERR_ERRSENDINGNOTICES 4809 Error sending notices A problem occurred sending out notices for a meeting. You may want to update the meeting again.
NotesError.NOTES_ERR_NEWERVERSIONEXISTS 4810 Newer version exists The icalentry data is not valid according to sequence. You should revise it or retrieve new data, and try again.
NotesError.NOTES_ERR_UNSUPPORTEDACTION 4811 Unsupported action The method is attempting to apply an action that is not valid for the entry, for example, attempting to cancel a meeting when you are not the chair.
NotesError.NOTES_ERR_IDNOTFOUND 4814 Identifier not found The recurrence identifier for the NotesCalendarEntry object does not identify an entry in the calendar.

Usage

The entry value must contain one VEVENT.

For a recurring entry, you must specify recurid. The iCalendar input must contain a single VEVENT and a UID.

Examples

This button event updates a calendar entry given its UID.
try {

var uid:string = sessionScope.currentuid;
if (uid == null || uid == "") {
	requestScope.status = "No current UID";
	return;
}
var dbdir:NotesDbDirectory = session.getDbDirectory("");
var maildb:NotesDatabase = dbdir.openMailDatabase();
var cal:NotesCalendar = session.getCalendar(maildb);
var cale:NotesCalendarEntry = cal.getEntry(uid);
var upd:String = cale.read().replace("T1600", "T1615");
cale.update(upd, "Pushing up 15 minues",
NotesCalendar.CS_WRITE_DISABLE_IMPLICIT_SCHEDULING +
NotesCalendar.CS_WRITE_MODIFY_LITERAL);
requestScope.status = "Update succeeded. UID = " + cale.getUID();

} catch(e) {
	requestScope.status = e.message;
}

LotusScript® syntax and examples

NotesCalendarEntry.Update(entry As String, Optional Byval comments As String, Optional scope as Integer, Optional flags As Long, Optional Byval recurid As String)
This agent updates a calendar entry given its UID.
Sub Initialize
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim cal As NotesCalendar
	Dim cale As NotesCalendarEntry
	Dim upd As String
	Dim uid As String
	uid = session.Getenvironmentstring("currentuid")
	If uid = "" Then
		MessageBox "No current UID",, "Error"
		Exit sub
	End If
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb)
	Set cale = cal.Getentry(uid)
	upd = Replace(cale.Read(), "T1600", "T1615")
	Call cale.Update(upd, "Pushing up 15 minues", _
	CS_WRITE_DISABLE_IMPLICIT_SCHEDULING + CS_WRITE_MODIFY_LITERAL)
	MessageBox "UID = " & uid,, "Updated entry"
End Sub

Java syntax and examples

void update(String entry)
void update(String entry, String comments)
void update(String entry, String comments, long flags)
void update(String entry, String comments, long flags, String recurid)
This agent updates a calendar entry given its UID.
import lotus.domino.*;

public class JavaAgent extends AgentBase {

    public void NotesMain() {

      try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();

          // (Your code goes here)
          String uid = session.getEnvironmentString("currentuid");
          if (uid != null) {
              DbDirectory dbdir = session.getDbDirectory("");
              Database maildb = dbdir.openMailDatabase();
              NotesCalendar cal = session.getCalendar(maildb);
              NotesCalendarEntry cale = cal.getEntry(uid);
              String upd = cale.read().replace("T1600", "T1615");
              cale.update(upd, "Pushing up 15 minues",
              NotesCalendar.CS_WRITE_DISABLE_IMPLICIT_SCHEDULING +
              NotesCalendar.CS_WRITE_MODIFY_LITERAL);
          }

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