views:

38

answers:

1

This problem is related to PIM package on BlackBerry SDK. I need to update calendar events on the device after synchronization is done. To check if new event is really new I do this call:

 EventList eventList = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
 Enumeration events = eventList.items(EventList.OCCURRING, Long.MIN_VALUE, Long.MAX_VALUE, true);

And after that I check incoming events against this 'events' list. If incoming event not found there I add it to the BB calendar. This supposed to prevent event duplication in the BB calendar. The problem is that those two lines do not work properly sometimes. That means, sometimes the 'events' list is empty (but the BB calendar contains those events!) and this cause event duplication (triplication, quadruplication etc.) in BB calendar. Does anybody had this problem and if yes how to fix it?

A: 

Finally I found what is the reason for Outlook events duplication. During synchronization with global database we check incoming events against BB event list provided through PIM interface. If incoming event not found in this list we add it to the calendar using PIM interface again. The problem is that if event occurred more than event expiration period ago than BB calendar service automatically deletes it from calendar. There is a setting in General Calendar Options called “Keep Appointments” which is defaulted to 60 days. Our idea is to check incoming event against this period and if event is not in calendar and it’s “Keep” period expired then not to add it to calendar again. So, we need for that to figure out what is this “Keep Appointments” setting. Can we do it using PIM or any other interface?

Victor