BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-01-2005, 04:22 PM   #1 (permalink)
New Member
 
Join Date: Aug 2005
Location: San Jose, CA
Model: 7230
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble adding new calendar entries to BB using Desktop API in Version 4

Please Login to Remove!

We are developing special software to link with a 3rd party app that accesses the Address book, Calendar and Tasks databases. we are using the latest Desktop 4.0.1.10 and are having trouble creating new appointments on the handheld.

For each of the three databases, we do the following to update new records through the DeskTop API version 3.6:

[code]

IRimRecordsPtr contacts;

contacts = contactTable->LoadRecords (RIM_Mode_ReadWrite);
.
.
IRimRecordPtr r;
.
.
r = contacts->AddRecord();

. add field data to r
.

HRESULT hr
LONG bbrecid;

bbrecid = 0; // generate a new Record ID
hr = r->raw_Update(&bbrecid);

.
.
contactTable->Update();

[\code]

For all other databases, this works and new records are added properly. For the Calendar, every invocation of Update() zeros out the ID and it becomes recID "0" on the handheld. As would be expected, each subsequent update overwrites its predecessor and we wind up with only one record in that database, namely the last one written. We have tried setting the RecordID's to known values from 1 to 10000 with the same results.

This code works in previous versions of the handheld OS - namely 3.6 and 3.7.



Any insight to this issue would be helpful!

Regards,

-Tony

Last edited by Altwies : 08-02-2005 at 10:42 AM.
Offline  
Old 08-03-2005, 11:54 AM   #2 (permalink)
New Member
 
Join Date: Aug 2005
Location: San Jose, CA
Model: 7230
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Problem Resolved

After a lot of investigation, we found that the 4.0 software has a bug such that when adding a new calendar record, the unique id for the calendar record always comes back as 0, which is what we observed in our tests. Unfortunatly, we had to upgrade to Version 4.0.2 of the OS because there is no known workaround using the API's for this.
Offline  
Old 08-05-2005, 06:56 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2004
Location: Metro NYC
Posts: 175
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've seen this also with 4.0. Was it resolved with 4.0.2?

Have you tested with different versions of the device OS (i.e. v4.0.0.160 vs v4.0.0.212, etc.)?

-- Aric
__________________
-- Aric Rosenbaum
BlackBerry consulting, BlackBerry development
www.arconsultinginc.com
BlackBerry consulting and development (RIM SI Partner)
Offline  
Old 08-05-2005, 06:58 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2004
Location: Metro NYC
Posts: 175
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

By the way, we worked around the issue by having the PC send data via USB to the device and then a USB listener on the device writes the data.

-- Aric
__________________
-- Aric Rosenbaum
BlackBerry consulting, BlackBerry development
www.arconsultinginc.com
BlackBerry consulting and development (RIM SI Partner)
Offline  
Old 08-05-2005, 11:28 AM   #5 (permalink)
New Member
 
Join Date: Aug 2005
Location: San Jose, CA
Model: 7230
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Version 4.0.2 solved the problem once we found and loaded that OS onto our 7230 test device. RIM said that this was a known problem on all 4.0 OS deliverables.

We thought of using your workaround solution but that requires a signed app running on the Blackberry and we thought that the upgrade was a better solution for us, for now.

On the other hand, we are still looking at the USB channel because the methods used in the Desktop API are very primitive and somewhat slow for lots of data.

We have users that routinely have 2 -3 thousand calendar entries. When the Desktop API does a database select, it moves all of the database records from the hand held to the local machine before you can read the first record. This is very slow for that quantity of data.

-Tony
Offline  
Old 08-06-2005, 01:27 PM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2004
Location: Metro NYC
Posts: 175
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

>> loaded that OS onto our 7230 test device

If you don't mind me asking, how do you plan on rolling this out to the general public? There are a lot of people out there with old versions of the 4.0 OS (i.e. 4.0.0.160, etc.) that will have the buggy uid of 0.


>> requires a signed app

Signing a BlackBerry app is trivial. This shouldn't scare you off.
__________________
-- Aric Rosenbaum
BlackBerry consulting, BlackBerry development
www.arconsultinginc.com
BlackBerry consulting and development (RIM SI Partner)
Offline  
Old 08-08-2005, 10:48 AM   #7 (permalink)
New Member
 
Join Date: Aug 2005
Location: San Jose, CA
Model: 7230
Posts: 8
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

A signed Blackberry app just requires some re-design of our methods. We are investigating this for other reasons as well, such as performance. Meanwhile, our clients are content that the OS upgrade to 4.0.2 is not a show stopper and they have been testing field upgrades to determine the difficulties involved. So far, it has been very straight forward.
Offline  
Old 08-17-2005, 01:38 AM   #8 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2005
Model: 8100
Carrier: Starhub
Posts: 92
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Our workaround solution is to set UID explicitly as a field data. For example, define a FIELD_TYPE_UID and set the value in pluggin. In handheld, if field FIELD_TYPE_UID is encountered, the field value will be read and the default uid value will be overwritten by the field value.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.