So in my Outlook Add-In (Office.js) I'm setting some custom properties to an calendar event, using following code:
const item = Office.context.mailbox.item;
item.loadCustomPropertiesAsync((result) => {
const props = result.value;
props.set("my_prop", "some value");
props.saveAsync((saveResult) => {
console.log("SAVE_CUSTOM_PROP", saveResult);
});
});
And it works fine, on a newly created event, after I save it and open it again, I can access the custom property value using following code:
const item = Office.context.mailbox.item;
item.loadCustomPropertiesAsync((result) => {
const props = result.value;
const my_data = props.get("my_prop");
console.log(my_data);
});
However when I open an existing event, with or without custom properties being set, the custom properties I'm setting doesn't get saved after the user saves the event.
If I open the event again it doesn't have the new custom properties, it has either none (if none wasn't set), or the old values which were set when the event was newly created (not yet saved).
It works as expected in Outlook for PC and OWA.
Outlook for Mac Add-in support bug? I'm doing something wrong?
saveAsync
is not supported on an event and no OutlookSpy. On Windows it works as expected. When I get the custom property after I set it - it's there. But when I save the event, and open it again, my change is gone. - alek kowalczyksaveAsync
on event is not available on Mac, it's available on theCustomProperties
object indeed, but that's saving the custom properties only on the offline opened object, not on the server. If I callsaveAsync
on the CustomProperties, the property is on the event, but when I save it and reopen, they are not there, and not on the server (not visible from OWA or Outlook on PC) - alek kowalczyk