cancel (NotesCalendarEntry - Java)
Cancels a meeting entry or entries.
Defined in
NotesCalendarEntrySyntax
void cancel(String comments)
throws NotesException
void cancel(String comments, String recurid, int scope)
throws NotesException
| Parameter | Description |
|---|---|
| comments | Comments regarding a meeting change. |
| scope | The scope of a recurring operation:
|
| 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.Examples
This agent cancels the first instance of a recurring meeting.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);
DateTime dt1 = session.createDateTime("Today 18");
DateTime dt2 = session.createDateTime("Today 18 01");
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyyMMdd");
String today = formatter.format(new java.util.Date());
String recurid = today + "T220000Z";
java.util.Vector entries = cal.getEntries(dt1, dt2);
if (entries.size() > 0) {
NotesCalendarEntry cale = (NotesCalendarEntry)entries.firstElement();
cale.cancel("No meeting today", NotesCalendarEntry.CS_RANGE_REPEAT_CURRENT, recurid);
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
Language cross-reference
Cancel method in LotusScript® NotesCalendarEntry class