Set CustomProperties on appointment for all attendees
Asked Answered
D

1

8

tl;dr

When setting CustomProperties to an appointment that has attendees, only the appointment for the organizer gets the CustomProperties. The properties do not propagate to the appointments of the other attendees.


Longer version

When we create an appointment with multiple attendees and then log in as each attendee, we notice that each ItemId is different. So, it appears that each attendee in a meeting gets their own copy of an appointment. (Would really like someone to confirm this is true).

However, when setting a custom property from our add-in (using the Outlook JavaScript API), only the organizer's appointment gets the custom property as we are unable to see the custom property when we log in as any of the other attendees.

Snippets from our code that is relevant:

Office.initialize = function (reason) {
    $(document).ready(function () {
         Office.context.mailbox.item.loadCustomPropertiesAsync (onCustomPropertiesLoaded);
    });
};

function onCustomPropertiesLoaded(asyncResults) {
    _customProps = asyncResults.value;
}

//Set custom properties
_customProps.set("myProp", "true");
_customProps.saveAsync(customPropertiesOnSaved);

Is there a way to have each copy of the appointment have the custom property?

Disciplinarian answered 29/8, 2016 at 23:11 Comment(0)
G
3

When we create an appointment and have multiple attendees and then log in as each attendee, we notice that each ItemId is different. So, it appears that each attendee in a meeting gets their own copy of an appointment. (Would really like someone to confirm this is true).

Yes that's correct an attendees copy of the appointment is a separate new Item in that mailbox. On the back end Exchange server its a separate Mailbox Store Item they are not linked in any way (other then properties that can be used to correlate them) and the server does not update appointments in attendee mailboxes so they must always be updated by a client process (in the case of room mailbox the Mailbox assistant does this but this is still a client process that runs on the server).

However, when setting a custom property from our add-in, only the organizer's appointment gets the custom property as we are unable to see the custom property when we log in as any of the other attendees.

That is most likely happening because you need to first save the custom property on the Appointment before you add any attendees and send meeting invitations. Its important to first save the appointment with the property (or attachments) before you add any attendees, then when the server produces the invites those invites should include the custom property (you can check that is happening using a Mapi editor and looking at the invite being produced in the Sent Items folder of the Organiser). Its important to remember as the appointments aren't linked on the server updating the property on the organiser won't be reflected on the attendees copy unless your sending a Meeting update and that Meeting update is then accepted by the attendees which would then update their calendars.

Gregorygregrory answered 30/8, 2016 at 5:49 Comment(2)
We are running in the context of an add-in, so we don't have control over when attendees are added to the invitation. When the user clicks a button in our add-in, we are setting the custom property customProps.set("myCustomProp", true); and then saving the property on the appointment customProps.saveAsync(callback). I'm not sure what else we have access to that would get the custom properties into each invite.Disciplinarian
Yeah but you need to understand that what you doing will only ever update the store item of the user your accessing. You may need to rethink your design eg what information are you adding to the custom property ? and how are you using that at the attendees ? . One alternative to a custom property is if you grab the UniquieId for the meeting that is shared across all instances create an external Rest service that will store the information you want and then make your Addin query that external service using the uniqueId as the key etc.Gregorygregrory

© 2022 - 2024 — McMap. All rights reserved.