none
UWP app is not able to create appointments in an Office 365 calendar RRS feed

  • Question

  • We developed an UWP app with the following capabilities

    • appointments
    • appointmentsSystem

    We are able to create appointments using API AppointmentCalendar.SaveAppointmentAsync for an Exchange calendar and for a Google calendar, but we are not able to create appointments with the same API for an Office 365 calendar.

    From our development test we saw that

    • for an Exchange or Google calendar
      property AppointmentCalendar.OtherAppWriteAccess is Limited
      property AppointmentCalendar.SyncManager is != null 
    • Office 365 is SystemOnly
      property AppointmentCalendar.OtherAppWriteAccess has value SystemOnly
      property AppointmentCalendar.SyncManage is null

    What we must do in order to be able to create an appointment on an Office 365 calendar with an UWP app using UWP API at https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.appointments.appointmentcalendar?

    Friday, March 8, 2019 11:06 AM

All replies

  • Hi,

    Could you please tell me your OS version and target version of your project? Could you please share me the code snippet that you used about how you create appointments for Google calendar and Office 365?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 11, 2019 5:43 AM
    Moderator
  • Hi Roy

    here you can find a complete app to test the case https://github.com/DanieleScipioni/TestApp. After build and run, go to section CalendarExplorer, select AllCalendarsReadWrite, select one calendar connected to an Office 365 account and click the Add button to create appointments. Of course you have to setup an Office 365 account in WIN 10 Settings > Accounts > Email & app accounts.

    The test code used to create appointments is here below and is the same for all account types (Exchange, Google, Office 365 in my tests) 

            private async Task AddAppointment()
            {
                var now = DateTimeOffset.Now;
    
                var appointment = new Appointment
                {
                    Subject = "Appointment",
                    StartTime = now,
                    Duration = TimeSpan.FromMinutes(30),
                };
    
                await _appointmentCalendar.SaveAppointmentAsync(appointment);
                if (appointment.LocalId != string.Empty) _appointments.Add(appointment);
    
                var appointmentRecurrence = new AppointmentRecurrence {Unit = AppointmentRecurrenceUnit.Weekly, Interval = 1, DaysOfWeek = (AppointmentDaysOfWeek) (now.DayOfWeek + 1)};
                appointment = new Appointment
                {
                    Subject = "Appointment with recurrence",
                    StartTime = now.AddHours(1),
                    Duration = TimeSpan.FromMinutes(30),
                    Recurrence = appointmentRecurrence
                };
                
                await _appointmentCalendar.SaveAppointmentAsync(appointment);
                if (appointment.LocalId != string.Empty) _appointments.Add(appointment);
            }

    My OS version is 1803 build 17134.590. 

    Project TargetPlatformMinVersion and TargetPlatformVersion are both 10.0.16299.0


    Monday, March 11, 2019 10:28 AM
  • Hi,

    Well,I could not run your sample successfully. Could you please provide me a Minimal, Complete, and Verifiable example about this? From selecting a calendar to creating an appointment.  With it I could locate the problem more easily.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 13, 2019 9:54 AM
    Moderator
  • Hi Roy,

    which is the problem with this sample? What you were not able to do? Build problem? Run problem? Let me understand.

    I removed all unneeded code and I created a new sample app here https://github.com/DanieleScipioni/CalendarExplorer.

    Regards,

    Daniele


    Wednesday, March 13, 2019 2:15 PM
  • @Daniele,

    Roy is on vacation and I'll check his cases. I've tried your last sample, and I can click add and here are the result:

    1. Before I click add:

    2. After I click add:

    You can see that two appointments are created, is that what you expected? I'm using my office 365 account. Is that possible that your test office365 account is not well configured? It might be a account setting issue.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 19, 2019 2:45 AM
  • Hi Barry

    you can see the appointment created in my sample app, but can you find them in the Office 365 calendar using the web access at https://outlook.office365.com

    What is happening to me is that the both appointments with recurrence disappear after that the Windows 10 Calendar app execute the synchronization.

    It seems to me that the appointment are created locally but never synchronized with the Office 365 calendar server.

    Regards,

    Daniele



    Tuesday, March 19, 2019 8:11 AM
  • @Daniele,

    No, the appointments are not synced as you mentioned. I checked the API:

    AppointmentCalendar.SaveAppointmentAsync(Appointment) Method

    It says its usage is to:  Asynchronously saves the provided appointment to the calendar.

    But the strange thing is that either the doc here and the sample here haven't used the above API. They both show a UI for this: ShowAddAppointmentAsync

    It's not clear whether this is known issue. I will try consult this from my internal channel, this may need some time. Currently, as a workaround, if you want your user to add appointment on office 365, please try use the suggested method from the doc first. Once I get any info I will let you know on this thread.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 19, 2019 8:39 AM
  • @Barry

    we can't use ShowAddAppointmentAsync because our app creates many appointments with recurrence or without recurrence to user calendar (based on business criteria) and a method that shows an UI to ask user confirmation for each appointment is not suitable to do this.

    More over and most important, method SaveAppointmentAsync works correctly with an Exchange and with a Google calendar.

    Regards,

    Daniele




    Tuesday, March 19, 2019 9:15 AM
  • @Daniele,

    Yep I can understand your requirement. I'm working with my internal channel and they will take a look at this issue. 

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 20, 2019 1:57 AM
  • @Daniele,

    After working with my intenral channel, we can confirm that this is a known issue and it is for security reason. So the only way right now is to use ShowAddAppointmentAsync(). 

    And we can purpose a feature from ourside and you can also purpose a feature request from uservoice  and share us the link. But please understand that we cannot be sure about whether or when this feature can be added.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 27, 2019 1:47 AM
  • And by the way, can you share us the business impact here for your app?

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 28, 2019 2:16 AM
  • @Barry

    thanks for the update, anyway it sound obscure to me this "security" reason, having in mind that SaveAppointmentAsync works as expected with Exchange and Google calendars. ShowAddAppointmentAsync does not fit our needs.

    From a business prospective the consequences is that our enterprise customers cannot use Office 365 as mail provider with our UWP app and this is a big penalty.

    Regards,

    Daniele


    Friday, March 29, 2019 8:14 AM
  • @Barry

    here the feature request https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/37233151-allow-api-appointmentcalendar-saveappointmentasync on uservoice.

    Regards,

    Daniele

    Friday, March 29, 2019 9:17 AM
  • @Daniele,

    Thanks for the url. However the internal feedback is not that positive. So your uservoice is currently the option for you to report your feedback. And for your app,  currently I can only suggest that you may need to notice your customer about this specific situation.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 4, 2019 1:15 AM
  • @Barry

    regarding the integration between MS products Office 365 and UWP, the situation is very poor.

    Of course our customers are already notified about this specific problem.

    Please note that we made a similar test on iOS platform and there are no problems in that case.

    Best

    Daniele

    Thursday, April 4, 2019 7:38 AM