Κοινή χρήση μέσω


Create a recurring appointment series, instance, or exception

 

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

When you create a recurring appointment master (series), Microsoft Dynamics 365 creates individual appointment instances based on the specified recurrence information. You can also create individual recurring appointment instances and exceptions to those instances, and you can convert an appointment to a recurring appointment.

In This Topic

Create a recurring appointment series

Create a recurring appointment instance

Create a recurring appointment exception

Convert an appointment to a recurring appointment

Create a recurring appointment series

To create a recurring appointment series (a RecurringAppointmentMaster record), you can use the BookRequest message, the CreateRequest message, or the IOrganizationService.Create method.

When you create a recurring appointment series, the following things occur:

  1. A RecurringAppointmentMaster record (recurring appointment series) is created that contains the basic and recurrence information about the recurring appointment series. Each record can be uniquely identified using the RecurringAppointmentMaster.ActivityId property. Further, this recurring appointment series is also created and stored as an activity (ActivityPointer) record. The activity record can be uniquely identified using the ActivityPointer.ActivityId property.

  2. Individual recurring appointment instances are created based on the recurrence information and stored as Appointment records. These appointment objects are associated with the parent recurring appointment series using the Appointment.SeriesId property and have the same value as the parent recurring appointment series ID (ActivityPointer.SeriesId).

    The value of the Appointment.InstanceTypeCode property is set to Recurring Instance (picklist value 2) for these appointment objects.

    Note

    Recurring appointment instances are created based on the expansion model and the parameters that define it. More information:  Recurring appointment partial expansion model.

For sample code that demonstrates how to create a recurring appointment series, see Sample: Create, retrieve, update, and delete a recurring appointment.

Create a recurring appointment instance

To create a recurring appointment instance (a RecurringAppointmentMaster record), you can use the CreateInstanceRequest. This message takes two parameters: the number of instances to be created and the recurring appointment series for which the instances have to be created.

The instances are created after the last instance in the recurring appointment series. Also, the instances are only created up until the future instance cutoff date, regardless of the number of instances you have specified for creation.

Create a recurring appointment exception

An exception is created when you either update or delete an instance of the recurring appointment. Recurring appointment instances are stored as an appointment record along like other appointments, and you can identify a recurring appointment instance using the Appointment.InstanceTypeCode attribute of an appointment record, which will have a value of Recurring Instance (picklist value 2).

You can create exceptions in the following ways:

  • Use the UpdateRequest class on the Appointment entity to update a recurring appointment instance, and set the value of the Appointment.InstanceTypeCode attribute to Recurring Exception (picklist value 3).

  • Use the DeleteRequest class on the Appointment entity to delete a recurring appointment instance. Deleting an appointment instance marks it an exception by creating an entry for the instance in the RecurringAppointmentMaster.DeletedExceptionsList attribute for the parent appointment series object.

  • Use the CreateExceptionRequest class on the Appointment entity.

Convert an appointment to a recurring appointment

A recurring appointment is an appointment with recurrence information. You can convert an existing appointment in Microsoft Dynamics 365 to a recurring appointment by using AddRecurrenceRequest. When you convert an existing appointment to a recurring appointment, the data from the existing appointment is copied to a new recurring appointment master instance and the existing appointment is deleted.

See Also

Recurring appointment entities
Update a recurring appointment
Sample: Create, retrieve, update, and delete a recurring appointment
Sample: Convert an appointment to a recurring appointment

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright