MAPI and CustomProperties |
Post Reply |
Author | |
zeko78
Groupie Joined: 21 August 2006 Location: Norway Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 27 August 2006 at 10:44am |
Hi,
I'm trying to set (and save) a custom property with each event, using the MAPI dataprovider.
I've added a button to the Calendar sample app with the following code:
CalendarEvents events = frmMain.Instance.wndCalendarControl.DataProvider.GetAllEventsRaw();
for (int i = 0; i < events.Count; i++) {
MessageBox.Show(events[i].Id.ToString() + ": " + events[i].Subject + "\n" + events[i].CustomProperties["PowerOfficeGUID"]); try {
String propVal = events[i].CustomProperties["PowerOfficeGUID"].ToString(); } catch (NullReferenceException) { MessageBox.Show("CustomProperties.Count=" + events[i].CustomProperties.Count.ToString()); events[ i].CustomProperties["PowerOfficeGUID"] = events[i].Id.ToString(); //Just some data, will be something else in real life app
frmMain.Instance.wndCalendarControl.DataProvider.ChangeEvent(events[i]); MessageBox.Show("CustomProperties.Count=" + events[i].CustomProperties.Count.ToString());
} } frmMain.Instance.wndCalendarControl.DataProvider.Save();
frmMain.Instance.wndCalendarControl.Populate(); frmMain.Instance.wndCalendarControl.RedrawControl(); However, after running through this code the new properties isn't there.
The messageboxes showed that a property was added, but when running the code again, the CustomProperties.Count shows zero again.
I'm simply not able to get the new CustomProperty to "attach" to the event.
What am I missing? How do I save the customproperty after adding it to the event?
Best regards,
Gøran
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
Unfortunately, in the current version of the MAPI DataProvider a collection of Custom Properties is not yet supported... They are not saved correctly into MAPI. As a workaround I can recommend you to store your properties in some custom map or array. Also, one of a nearest updates should have updated DataProvider with this functionality fixed. -- WBR, Serge |
|
zeko78
Groupie Joined: 21 August 2006 Location: Norway Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Hi Serge,
How can I get some kind of uniqe identifier for the event to link my "custom map or array" and the event? The event.id for a particular event changes each time I run the Calendar sample app.
The Custom Properties with the MAPI provider is very important to us, and I don't see any way we can use it without...
Do you have an idea about when the a new version with support for this will be avilable?
Best regards,
Gøran
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Should be avalable in a nearest couple of weeks (10.3.1).
Contact support (www.codejock.com/support) if you'd like to get a fix earlier. -- WBR, Serge |
|
zeko78
Groupie Joined: 21 August 2006 Location: Norway Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Thanks Serge,
I'll be experimenting with custom DataProvider for a while, so no immediate need for a fix.
Best regards,
Gøran
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |