Office.js item saveAsync doesn't save all fields on new appointment - outlook-addin

I am using Office.context.mailbox.item.saveAsync in an Outlook add-in to save a new appointment. The returned item id is used to fetch the appointment using the REST api (a get request to Office.context.mailbox.restUrl + '/v2.0/me/events/' + itemId). This returns an appointment where Start, End, and Organizer is set correctly, but the Subject, Body, Location, Recurrence, Attendees is not set.
Does saveAsync not save all fields on the appointment?
I am using the REST api because the Recurrence field is not available through the Office.context.mailbox.item in older versions of the Outlook JavaScript API.

This scenario occurs when calling Office.context.mailbox.item.saveAsync on a new Calendar item that has not been sent yet. This has been fixed in the new Outlook Web beta. The API should behave as designed in Mail and on Existing Calendar items. Note that for existing Calendar items, an update may be sent out to attendees depending on the changes that the user or the add-in made in the compose form.

Related

Best approach to update an existing event in multiple Microsoft accounts using Microsoft Graph API

I am working on a calendar synchronization between my application and personal calendars of the users. The idea is that every time an event is created or updated, this event is sent to the personal calendar of the users (they can choose syncing to Google Calendar and/or Microsoft accounts calendar).
I have this complete flow working with Google Calendar and now I am working with Microsoft oAuth and Graph API to make it work either for MS Calendars.
Currently, for MS, I have the following scenario implemented and working:
User authorizes the application to access its calendar through consent page
Server exchanges the authorization code for an access token
I can insert an event in user's calendar using its access token as Authorzation header through Microsoft Graph API (POST https://graph.microsoft.com/v1.0/me/events)
Now I am trying to figure out how I can manage event updates (when start date changes, for instance, how I will send this update for each user's MS account), knowing the following constraints of Microsoft Events API:
Property "ICalUId" is generated by MS API itself and returned in the response of Insert endpoint. I can't insert an event with my own ICalUId. This is possible with Google Calendar and very useful, because if I send an event with an existing iCalUId to import endpoint, Google updates this existing event with the sent data, and if the iCalUId doesn't exist, Google creates the event (it performs an upsert-like action).
For each event inserted at different users calendar, a new "ICalUId" is generated, even if I am sending the same event object to insert. So I get many iCalUId's for the same event, this adds complex in tracking this event in users calendars, different from Google Calendar as I mentioned before.
So that's the challenge I am facing right now. Any ideas on how I can achieve this?
Thanks in advance!

Finding Where Previous Email In Conversation Is Stored in a Shared Inbox

When receiving a reply to an email that has already been in a shared inbox, I want to store it to the same folder as the previous email.
Came as far as understanding Conversation ID buildup, but couldn't find how to read the properties of the previous conversation.
The Outlook object model provides the GetConversation method which obtains a Conversation object that represents the conversation to which this item belongs. GetConversation returns Null (Nothing in Visual Basic) if no conversation exists for the item. No conversation exists for an item in the following scenarios:
The item has not been saved. An item can be saved programmatically, by user action, or by auto-save.
For an item that can be sent (for example, a mail item, appointment item, or contact item), the item has not been sent.
Conversations have been disabled through the Windows registry.
The store does not support Conversation view (for example, Outlook is running in classic online mode against a version of Microsoft Exchange earlier than Microsoft Exchange Server 2010). Use the IsConversationEnabled property of the Store object to determine whether the store supports Conversation view.
I guess the GetConversation doesn't work for shared accounts , see a similar thread for more information.

How to send a request to my add in when a user changes the date of a meeting inside outlook (without opening the add-in)?

I'm building an Outlook Add-in where the user can book a meeting directly from outlook. The add in is basically a shortcut to the website we usually use, but instead we take the data from the outlook meeting (Date, title, etc..). The problem is that once the user has created a meeting and it has been saved in our database (and they close the add-in), the add-in can't detect if they change the meeting date, and therefore it doesn't get updated in the database.
Shortly put: Is there any way that my add-in can communicate with outlook and fire a function without being opened?

sharepoint registration change notification

I have a class registration set up in SharePoint 2013. Users are emailed when they register for a class. I want to create email notifications when the Start Date, Start Time or Location [fields] of the Session changes. I only want to email the users that have registered for said Session (between 1 and 400 people).
I should be able to handle this with an Alert or an Event, but can't figure it out. My SharePoint team is telling me that this is too difficult because "the columns are in Sessions [list] and not in Registrations [list view].
I've found a lot of information on general SharePoint alerts, but I can't find anything on sending notifications to a select group of users, based on another field.
You could create event receiver for the list and send email by SPUtility.SendEmail with dynamic users.
You could check sample code from here.
Create event receiver in SharePoint 2013.

Outlook add-in: take action on calendar event date and time changes

We have an Outlook office.js add-in which uses add-in commands to help our users create a custom calendar event. We would like to perform some actions when that event's date or time is changed by the user.
With the older COM-based Outlook add-ins this was possible since you could have your add-in start-up automatically when a particular calendar event was opened add you could hook into the send event.
With the new add-in commands model there are problems. Here is what I understand so far:
When the user edits their event date or time while the add-in task pane is open, there is no way to be informed that they made changes. Worst yet, the user can open the event up later from their calendar and unless they triggered your add-in task pane, your add-in will not even be running. The user has to manually trigger an Outlook add-in command to open your task pane since the task pane cannot auto-trigger based on some detectable data attached to the calendar item.
If you hook into the send event you might be able to call the Outlook REST API to get the date and time and perform actions. Unfortunately, to hook into the on send event you need an Administrator to turn on that feature and your add-in will be rejected for Office Store Validation. Besides, I am not sure if the on send event works for calendar items. It seems like it is limited to emails.
If you want to use the Outlook Notification REST API to be notified about calendar event creation/modification/deletion, that notification subscription is time limited, does not have a way to auto-renew the notification subscription, and there does not seem to be built-in way to pass back custom parameters to the notification listener.
I hope I was clear enough and that the details I list above are accurate.
Does anyone have any suggestions on how we can automatically perform actions when the user edits the date or time of one of the calendar events created by our add-in?
This is done by leveraging Webhook Subscriptions and Event Deltas via Microsoft Graph.
The webhook will get fired off whenever it detects a change to the calendar. When you receive the event, you request the calendar delta from Microsoft Graph. This will give you all of the events that were changed since the last time you polled. From here you can request a specific event, including any extended data you previously stored with that event.
As for renewals, when you create the subscription it returns the expirationDateTime for that subscription. When your subscription expires, you can renew it and receive a new expiration date:
PATCH https://graph.microsoft.com/v1.0/subscriptions/{id}
Content-Type: application/json
{
"expirationDateTime": "2016-03-22T11:00:00.0000000Z"
}