0

Running into a slight annoyance. The application I'm developing has a calendar system built in that feeds appointments to an icloud calendar in outlook for the purpose of synchronising to phones are spread out over multiple icloud calendars (one for each person)

My problem lies in updating these appointments when changes are made on the main application. I know already that I can use AppointmentItem.GlobalAppointmentID to gain the id of the entry placed in the calendar on the computer it was created on, however I'm lead to believe this is only unique for that system (ie, another user on a different computer with the calendar synchronised would have a different set of global ID numbers)

As this number is different for each item, simply storing the GlobalAppointmentID in the database and having the application refer to that when adding/deleting/modifying an appointment wouldn't work as a reference point.

In an ideal world, I'd be using an exchange server to handle all of this, or directly modifying the appointments in icloud using c# (despite my best efforts ive been unable to find a simple method to implement this)

Am I missing something here, or is there no way to identify a unique calendar appointment entry after it has been synchronised?

Takarii
  • 1,612
  • 2
  • 18
  • 29
  • Please enhance your question. Are you using the iCloud Control Panel for Windows to synchronize items with Outlook? How does your other application access the items, EventKit? Also, if Exchange is your 'ideal world', why don't you use that but iCloud? iCloud/CalDAV events all have a unique UID, the UID. And the same is true for Exchange/Outlook - and you get that by GlobalAppointmentID as the name suggests. Why do you think it is unique for the system, it explicitly says 'global' :-) The fast local ID is accessed using the EntryID property. – hnh Mar 15 '16 at 10:39
  • EntryID is unique for a single calander, so you could have 2 appointments with the same EntryID but in different calendars. The impression I was given based on [This MSDN post](https://msdn.microsoft.com/en-us/library/office/ff863645.aspx) is that the global ID that outlook provides when you access the attribute is still localised, but wont change when appointments are moved between calendars. Using the Panel to sync, but as mentioned im strugglign to find a simple method to implement CalDAV into my C# program – Takarii Mar 15 '16 at 10:44
  • The linked post is explicit about that: "The Global Object ID is the same across all copies of the item". This is particularly true for the iCP which maps the CalDAV UID to the GlobalObjectID (the raw CalDAV UID should also be available via a MAPI property, check OutlookSpy). BTW: The EntryID won't usually change during moves either, only if you leave a particular Outlook datafile (or make a copy, in this case a new one will be created). – hnh Mar 15 '16 at 10:53
  • So the unique identifier ive been looking for - the same one that the icloud uses and i reeeeeally wanted to access - has been sat right infront of me this entire time? I wasn't aware that icloud would be mapping said ID number to the property. – Takarii Mar 15 '16 at 10:56
  • It is not *exactly* the same (the GID is a binary structure, the UID is just a string), but the Outlook GlobalObjectID in iCP is derived from the CalDAV UID. And as mentioned you should also be able to access the raw UID using a custom Apple property. The implementation of that could change of course. BTW: I think the same is true if Outlook itself imports iCalendar meeting requests etc. Don't remember all the details anymore. – hnh Mar 15 '16 at 11:12

1 Answers1

1

Your approach is correct. GlobalAppointmentID is the proper way to obtain a global identifier for an Outlook calendar item:

The Global Object ID is the same across all copies of the item.

Detailed information on the properties related to that can be found in MS-OXOCAL.

In the case of the iCloud Control Panel, the GlobalAppointmentID will be derived from the UID iCalendar property. It should also have the raw iCalendar UID available in a separate MAPI property (you can discover such using a tool like OutlookSpy - a tool you should buy if you want to do any serious MAPI development, really).

Note that you should use the GlobalAppointmentID only for operations which are cross folder. The local identification property is the EntryID, which is like the primary key in a relational database.

P.S.: This question has some information on building a CalDAV client. Depending on what exactly you want to do, it might not be that hard - it's just an HTTP protocol with a text based payload (iCalendar).

Community
  • 1
  • 1
hnh
  • 13,957
  • 6
  • 30
  • 40
  • Wonderful. Needed to test it out properly at my end, but this answers my question perfectly. Thank you – Takarii Mar 16 '16 at 10:02