Udostępnij za pośrednictwem


Update a recurring appointment

 

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

You can either update the whole series or update an instance of a recurring appointment.

Update a recurring appointment series

You can update a recurring appointment series by using the IOrganizationService.Update method or the UpdateRequest message on the RecurringAppointmentMaster entity. You can update the basic or recurrence information.

Update basic information

When you update the basic information of a recurring appointment series, such as subject, location, or attendees, all instances in the recurring appointment series are updated except those that have exceptions on the same attribute.

Update recurrence information

When you update the recurring information of a recurring appointment series, such as pattern and range, the following things occur:

  1. A new series with a new RecurringAppointmentMaster.ActivityId is created that has the same information as the original series, and the date in the RecurringAppointmentMaster.EffectiveEndDate attribute of the new series is set to the last occurring past instance of the original series. All the future instances of the original series are deleted. In this manner, the original series is ended, and the history of the past instances is preserved in the system by storing it in a new series.

  2. The new information is used to create the future instances of the new series from the effective start date (RecurringAppointmentMaster.EffectiveStartDate).

Also, the RecurringAppointmentMaster.GroupId attribute for both the original and the new series is populated with the same value. This implies that whenever you update the recurrence information in a recurring appointment series, all the new series’ that are created have the same value for the RecurringAppointmentMaster.GroupId attribute as the recurring appointment series that is updated, although each series has a unique series ID.

Note

When you update the recurrence information of a recurring appointment series that has all the instances slated to occur in future, all instances are deleted and new recurrence information is used to create or expand new instances.

To see the sample code for updating a recurring appointment series, see Sample: Reschedule and cancel a recurring appointment.

Update a recurring appointment instance

Because the recurring appointment records are stored as appointment objects, you can use the IOrganizationService.Update method on the Appointment entity to update a recurring appointment instance. When you update a recurring appointment instance, the instance is marked as an exception to the recurring appointment series. More information:  Create a recurring appointment exception

You can also use the CreateExceptionRequest class on the Appointment entity to update a recurring appointment instance.

Tip

Recurring appointment instances can be identified using the Appointment.InstanceTypeCode attribute, which will have a value of “2” (Recurring Instance). More information:  Appointment entity messages and methods

See Also

Recurring appointment entities
Delete or end a recurring appointment series or instance
Sample: Create, retrieve, update, and delete a recurring appointment
Sample: Reschedule and cancel a recurring appointment

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright