Print Page | Close Window

MAPI and CustomProperties

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=4892
Printed Date: 22 November 2024 at 4:10pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MAPI and CustomProperties
Posted By: zeko78
Subject: MAPI and CustomProperties
Date 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



Replies:
Posted By: sserge
Date Posted: 28 August 2006 at 2:08am
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


Posted By: zeko78
Date Posted: 28 August 2006 at 3:41am
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
 


Posted By: sserge
Date Posted: 28 August 2006 at 5:11am
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


Posted By: zeko78
Date Posted: 28 August 2006 at 5:22pm
Thanks Serge,
 
I'll be experimenting with custom DataProvider for a while, so no immediate need for a fix.
 
Best regards,
Gøran



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net