I have an Outlook addin for calendar events (Office 365 Web), which has a taskpane to show info for the user.
I have a problem when I edit a recurrence event, "this event and the following".
These are my steps:
I open an event on day_1, and set a 'daily' recurrence for 3 days [day_1, day_2, day_3].
Then I open my taskpane and I can read the id from Office.context.mailbox.item:
item1_id
and the recurrence info:
{"recurrenceProperties":{"interval":1},"recurrenceType":"daily","recurrenceTimeZone":{...},"seriesTime":
{"startYear":2020,"startMonth":10,"startDay":27,"endYear":2020,"endMonth":10,"endDay":29,"startTimeMinutes":600,"durationMinutes":30}
}
Then I save the event in the calendar.
A) If I open "all the series" to edit I read from the Office.context.mailbox.item:
seriesId: null
itemId: seriesId (=item1_id, saved value when series created --> I know it is my series)
B) If I open a single event to edit, I read:
seriesId: seriesId (=item1_id, saved value when series created --> I know it is an event from my series)
itemId: itemB
C) If I open to edit "day_2 and the following", I read:
seriesId: null (it is correct?)
itemId: itemC ( I don't know this event is from the series I created...)
My code:
Office.onReady(info => {
g_item = Office.context.mailbox.item;
g_itemId = g_item.itemId;
if (g_itemId === null || g_itemId == undefined) {
g_item.saveAsync(function (result) {
g_itemId = result.value;
g_item.recurrence.getAsync((asyncResult) => {
if (asyncResult.status !== Office.AsyncResultStatus.Failed) {
g_recurrence = asyncResult.value;
console.log("Recurrence: " + JSON.stringify(g_recurrence));
console.log("ITEM ID: " + g_itemId);
console.log("SERIES ID: " + g_item.seriesId);
}
});
});
}
else
console.log("**** itemId found: " + g_itemId);
});
I hope you can understand my problem...
Thanks,
Diego