Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
Need to remove all occurrences of an appointment except itself
posted

In the BeforeDiplauAppointmentDialog I use the custom dialog and then a custom dialog for recurrence, In the recurrence dialog I add a check box if the user wants the occurrence to be deleted.  When the user clicks ok with both form I need all the occurences of this appointments to be removed. I set the Recurrence =NULL but nothing is happening. What is wrong please?

Parents
  • 23930
    Offline posted

    Hi Alex,

    Thank you for posting in our forums.

    Setting the Recurrence property to null should remove all the recurrences of this appointment. However this will only work if you do this to the root appointment, not one of its recurrences. Maybe this is the issue in your case. What you can do in order to prevent this is to simply check if this is the root appointment and if it isn’t to use the RecurringAppointmentRoot property in order to get it:

             private static void RemoveRecurrence(Appointment app)
            {
                if (app.IsRecurringAppointmentRoot == false)
                    app = app.RecurringAppointmentRoot;

                if(app != null)
                    app.Recurrence = null;
            }

    Let me know if this suggestion resolves your issue.

Reply Children