Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
Hilehele
Posts: 6
Registered: ‎03-04-2013
My Device: Developer

CalendarEvent with Recurrence

Hello,

 

I have successfully been able to create a CalendarEvent in the CalendarService, however I am struggling with setting a finite Recurrence with weekly frequency to the event.

 

From documentation: "A finite recurrence has an end date or a number of occurrences."

 

I've tried both of the following, where both respond with recurrence.isValid() = true, and the CalendarService's createEvent method returns a success result. Yet on the simulator, I run into issues with both cases

 

i) Finite # of occurences

In this example, I attempt to set the number of occurences to 9, however when the CalendarEvent is created in the service, I do not see all 9 occurences within the native calendar application

 

Image showing details of recurring event (note that the recurrence info is correct)

http://imgur.com/a/Xw9VL#0

 

Image showing month view (note that there should be events for the MWF on week of March 11 and March 18)

http://imgur.com/a/Xw9VL#1

 

Code:

CalendarEvent event;
...

Recurrence weeklyRec;
weeklyRec.setFrequency(Frequency::Weekly);
weeklyRec.setNumberOfOccurrences(9);
weeklyRec.setDayInWeek(DayOfWeek::Monday | DayOfWeek::Wednesday | DayOfWeek::Friday);
if (event.isValid()) {
   event.setRecurrence(weeklyRec);
}

bb::pim::calendar::Result::Type result = m_calendarService->createEvent(event);

ii) Set Until Date

In this example, I use setUntil to set the until date to a month afterwards. While the recurrence is valid and the event gets successfully added, the next time I open the month view in the native calendar app, it loads forever and never displays the new recurring calendar event.

 

Image showing loading (note: even when I restart the simulator, this loading persists)

http://imgur.com/a/Xw9VL#2

 

Code:

CalendarEvent event;
...

Recurrence weeklyRec;
weeklyRec.setFrequency(Frequency::Weekly);
weeklyRec.setUntil(QDateTime::currentDateTime().addMonths(1));
weeklyRec.setDayInWeek(DayOfWeek::Monday | DayOfWeek::Wednesday | DayOfWeek::Friday);
if (event.isValid()) {
   event.setRecurrence(weeklyRec);
}

bb::pim::calendar::Result::Type result = m_calendarService->createEvent(event);

 

There has been a similar question here (http://supportforums.blackberry.com/t5/Cascades-Development/How-to-create-Calendar-Recurrence/m-p/21... though it has not received a response yet.

 

Please, any assistance would be greatly appreciated!

Please use plain text.
Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30

Re: CalendarEvent with Recurrence

Does this work on an actual device? The finite # event details screenshot makes it look like it's definitely a bug somewhere, as clearly the calender knows it's recurring on some level.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Please use plain text.
New Contributor
Hilehele
Posts: 6
Registered: ‎03-04-2013
My Device: Developer

Re: CalendarEvent with Recurrence

[ Edited ]

Hi Paul,

 

We have replicated the issue for both cases on an actual device (dev alpha B), and are now in the midst of resetting / restoring the OS due to the loading malfunction resulting in case 2 (using until date).

Please use plain text.
Retired
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold

Re: CalendarEvent with Recurrence

I am assuming you are using the latest SDK (10.0.10.261) and OS (10.0.10.263) versions available?


If not, it is always advisable to update to the latest OS versions; more info here - http://developer.blackberry.com/devzone/blackberry10devalpha/devalpha_update.html

 

If you are still facing the same issue on the device using the latest OS/SDK version, as Paul indicated, this is most likely a bug. Please file a bug through the Developer Issue Tracker. Link: https://www.blackberry.com/jira/secure/Dashboard.jspa 
You can just try to copy/paste the same info you pasted here (more info, the better; include  the OS/SDK versions etc).


Paste back the DIT item link here and we will try to escalate it ASAP.

 

Cheers,
Rashid

 

 

Please use plain text.
Retired
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold

Re: CalendarEvent with Recurrence

On a side note (just in case you didn't know the following already):

 

* You can take screen shots directly on the device by pressing "Volume Up" and "Volume Down" key at the same time; that saves the screen shots as images under the shared folders ("Camera").

* You can also make use of the controller for the simulator to use various things: http://developer.blackberry.com/develop/simulator/simulator_controller.html

http://developer.blackberry.com/develop/simulator/simulator_configuring.html

 

 

 

Please use plain text.
New Contributor
Hilehele
Posts: 6
Registered: ‎03-04-2013
My Device: Developer

Re: CalendarEvent with Recurrence

Yes, we're currently using the Dev Alpha B device with OS version 10.0.10.263, and we've tested on both the 10.0.10.263 SDK target, as well as SDK version 10.0.09.1673. 

I've also tried using the 10.1 beta SDK, with the newest Q10 simulator and have run into similar problems.

 

I'll create an issue for it, thank you for your assistance.

Please use plain text.
New Contributor
Hilehele
Posts: 6
Registered: ‎03-04-2013
My Device: Developer

Re: CalendarEvent with Recurrence

Here is the posted DIT item link:

 

https://www.blackberry.com/jira/browse/BBTEN-956

 

Thanks a lot for the help, everyone.

Please use plain text.
Retired
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold

Re: CalendarEvent with Recurrence

Thanks for creating the DIT issue. We already carried it over to the internal issue tracker and will try to escalate it as much possible with the internal product & development teams. However, if this indeed a bug and if it does need to be fixed on the platform/OS level, it will probably be a couple of months before the public developer OS versions will have the fix.

Please use plain text.
New Contributor
Hilehele
Posts: 6
Registered: ‎03-04-2013
My Device: Developer

Re: CalendarEvent with Recurrence

What do you suggest as an alternative in the meantime?

 

I can create a unique CalendarEvent for each day of the week within the recurrence (and hence ignore setting the Recurrence property). While this is slightly more expensive, I'm more worried about flooding the service with too many events. 

Is there a limit to how many CalendarEvents can be created within the CalendarService?

 

Also, is there a way to create a new CalendarFolder within the API, where I can put these events?  
(I noticed a post here http://supportforums.blackberry.com/t5/Cascades-Development/How-do-I-create-a-Calendar-Folder/m-p/20... which asks this question, though it has not yet received a response)

Please use plain text.
New Contributor
Hilehele
Posts: 6
Registered: ‎03-04-2013
My Device: Developer

Re: CalendarEvent with Recurrence

As well, why is it that Recurrence has both an "end" QDateTime property, and an "until" QDateTime property?

 

According to the documentation, "until" is the property I should be using to set an endpoint for a finite recurrence (if not directly setting a finite number of occurences). I assume "start" indicates on what date the recurrence should begin. So what is the purpose of "end" in this case?

Please use plain text.