Dear Forum,
I have implemented an application which adds a new item in the calendar appointment menu (and not in the calendar menu
). This new item is called "Remove Appointment" and especially performs the removal of the current opened appointment.
The code is here:
Code:
ApplicationMenuItemRepository rep = ApplicationMenuItemRepository.getInstance();
MyMenuItem mmi = new MyMenuItem();
repository.addMenuItem(ApplicationMenuItemRepository.MENUITEM_CALENDAR_EVENT, mmi);
Code:
public class MyMenuItem extends ApplicationMenuItem{
...
public String toString()
{
return "Remove Appointment";
}
...
public Object run(Object context)
{
Event event = (Event)context;
EventList el = null;
el = (EventList)BlackBerryPIM.getInstance().openPIMList( BlackBerryPIM.EVENT_LIST, BlackBerryPIM.READ_WRITE );
el.removeEvent(event);
}
}
This code works properly except that the removal of the event does not act as the delete command of the same menu. Indeed, removeEvent() correctly removes the appointment from the calendar but does not send a meeting cancellation to attendees.
The "Delete" command removes the meeting but also proposes to send meeting cancellation to attendees too.
So, my question is the following: is there a way to programatically delete an appointment as the "Delete command" does?
Thank you a lot for your precious help.
Mikal Donini, Arkadin France.