Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - MAPI and CustomProperties
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MAPI and CustomProperties

 Post Reply Post Reply
Author
Message
zeko78 View Drop Down
Groupie
Groupie


Joined: 21 August 2006
Location: Norway
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote zeko78 Quote  Post ReplyReply Direct Link To This Post Topic: MAPI and CustomProperties
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
zeko78 View Drop Down
Groupie
Groupie


Joined: 21 August 2006
Location: Norway
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote zeko78 Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
zeko78 View Drop Down
Groupie
Groupie


Joined: 21 August 2006
Location: Norway
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote zeko78 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.