When opening my add-in in an appointment that is displayed the the view model mentioned in the title, Office.context.mailbox.item should not be null.
When opening my add-in in an appointment that is displayed the the view model mentioned in the title, Office.context.mailbox.item is always null. I don't mean Office.context.mailbox.item or Office.context.mailbox.item.itemId. Also this is working correctly for messages (e-mails).
Trying to use the add-in to link some data to the item whithin our CRM software. It works fine for e-mails (Office.MailboxEnums.ItemType.Message).
In edit mode the add-in is loaded inside the taskbar and the item is set.

Adding @annich-MS from the Outlook team.
Hi, are you by chance attempting to get the itemid of an appointment that you are the organizer for? Currently items that you created open in compose mode. Per the documentation here:
The itemId property is not available in compose mode. If an item identifier is required, the saveAsync method can be used to save the item to the store, which will return the item identifier in the AsyncResult.value parameter in the callback function
This means that in add-ins being run on an calendar item that you created, you must get the itemid from saveAsync.
I can not use saveAsync on the item, because the item itself is null. I know that I can not just get the itemId in some cases, that's why my code looks like this:
window.currentItemID = Office.context.mailbox.item.itemId;
if (Office.context.mailbox.item.saveAsync) {
Office.context.mailbox.item.saveAsync(function (asyncResult) { // HOW TO GET THE ITEM ID
window.currentItemID = asyncResult.value;
initialStuff();
});
} else {
initialStuff();
}
This will throw the mentioned error: Uncaught TypeError: Cannot read property 'itemId' of null
I'm unable to repro this myself. Is there a way you can give me a gist that repros this?
Host the test.html on https://localhost/test.html and load the add-in via the manifest (simpleAddin.xml).
[Object, Object] - all good here!Open the following URL with your EXCHANGE_SERVER_URL and the copied ITEM_ID:
https://
[EXCHANGE_SERVER_URL]/owa/#ItemID=[ITEM_ID]&exvsurl=1&viewModel=ICalendarItemDetailsViewModelFactory
Open the add-in, it will print out null, as the item is null in this situation.
@annich-MS did you manage to reproduce the issue with the provided example (simpleTestForNullProject.zip)?
So no update yet?
It appears that you're attempting to create a deep linking scenario. This scenario is not officially supported in any version of outlook. You can request this feature in our User Voice