remove (NotesCalendarEntry - JavaScript)

Removes a meeting entry or entries.

Defined in

NotesCalendarEntry

Syntax

remove() : void

remove(scope:int, recurid:string) : void

Parameter Description
scope The scope of a recurring operation:
  • CS_RANGE_REPEAT_ALL (1)
  • CS_RANGE_REPEAT_CURRENT (0)
  • CS_RANGE_REPEAT_FUTURE (3), inclusive
  • CS_RANGE_REPEAT_PREV (2), inclusive
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_INVALIDID 4757 Invalid ID The identifier for the NotesCalendarEntry object is not valid.
NotesError.NOTES_ERR_RECURID_NOTFOUND 4808 Recurrence-ID not found The recurrence identifier for the NotesCalendarEntry object is not valid.
NotesError.NOTES_ERR_IDNOTFOUND 4814 Identifier not found The recurrence identifier for the NotesCalendarEntry object does not identify an entry in the calendar, or the scope and recurid are missing for a recurring entry.

Usage

This method deals with meeting entries, not notices.

Usage

If AutoSendNotices is true, remove works as follows:
  • Deletes (hard delete) a non-meeting entry such as an appointment.
  • Cancels a meeting for which you are the organizer and removes it from your calendar.
  • Declines a meeting for which you are an invitee and removes it from your calendar.

If AutoSendNotices is false, remove deletes (hard delete) an entry.

This method deals with meeting entries, not notices.

Examples

This button event removes the entry, or all recurring entries, for a given UID.
try {

var uid:string = sessionScope.currentuid;
if (uid == null || uid == "") {
	requestScope.status = "No current UID";
	return;
}
var recurid:string = sessionScope.currentrecurid;
var dbdir:NotesDbDirectory = session.getDbDirectory("");
var maildb:NotesDatabase = dbdir.openMailDatabase();
var cal:NotesCalendar = session.getCalendar(maildb);
var cale:NotesCalendarEntry = cal.getEntry(uid);
if (recurid == null || recurid == "") {
	requestScope.status = "Removing UID = " + cale.getUID();
	cale.remove();
} else {
	requestScope.status = "Removing UID = " + cale.getUID() + ", all instances of " + recurid;
	cale.remove(NotesCalendarEntry.CS_RANGE_REPEAT_ALL, recurid);
}

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

LotusScript® syntax and examples

NotesCalendarEntry.Remove(Optional scope as Integer, Optional Byval recurid As String)
This agent removes the entry, or all recurring entries, for a given UID.
Sub Initialize
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim cal As NotesCalendar
	Dim cale As NotesCalendarEntry
	Dim uid As String
	Dim recurid As String
		uid = session.Getenvironmentstring("currentuid")
	If uid = "" Then
		MessageBox "No current UID",, "Error"
		Exit sub
	End If
	recurid = session.Getenvironmentstring("currentrecurid")
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb)
	Set cale = cal.Getentry(uid)
	If recurid = "" Then
		Call cale.Remove()
		MessageBox "UID = " & uid,, "Removed entry"
	Else
		Call cale.Remove(recurid, Cs_range_repeat_all)
		MessageBox "UID = " & uid & ", Recur ID = " & recurid,, _
		"Removed all entry instances"
	End If
End Sub

Java syntax and examples

void NotesCalendarEntry.remove()
void NotesCalendarEntry.remove(int scope, String recurid)
This agent removes the entry, or all recurring entries, for a given 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) {
        	  String recurid = session.getEnvironmentString("currentrecurid");
              DbDirectory dbdir = session.getDbDirectory("");
              Database maildb = dbdir.openMailDatabase();
              NotesCalendar cal = session.getCalendar(maildb);
              NotesCalendarEntry cale = cal.getEntry(uid);
              System.out.println("recurid = " + recurid);
              if (recurid == null || recurid.length() == 0) {
            	  cale.remove();
              } else {
            	  cale.remove(recurid, NotesCalendarEntry.CS_RANGE_REPEAT_ALL);
              }
          }

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