Create a recurring appointment series, instance, or exception
When you create a recurring appointment master (series), Microsoft Dataverse 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.
Create a recurring appointment series
To create a recurring appointment series (a RecurringAppointmentMaster row), 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:
A
RecurringAppointmentMasterrow (recurring appointment series) is created that contains the basic and recurrence information about the recurring appointment series. Each row can be uniquely identified using theRecurringAppointmentMaster.ActivityIdproperty. Further, this recurring appointment series is also created and stored as an activity (ActivityPointer) row. The activity row can be uniquely identified using theActivityPointer.ActivityIdproperty.Individual recurring appointment instances are created based on the recurrence information and stored as
Appointmentrows. These appointment objects are associated with the parent recurring appointment series using theAppointment.SeriesIdproperty and have the same value as the parent recurring appointment series ID (ActivityPointer.SeriesId).The value of the
Appointment.InstanceTypeCodeproperty is set to Recurring Instance (choice 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 row), 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 row along like other appointments, and you can identify a recurring appointment instance using the Appointment.InstanceTypeCode column of an appointment row, which will have a value of Recurring Instance (choice value 2).
You can create exceptions in the following ways:
Use the UpdateRequest class on the
Appointmenttable to update a recurring appointment instance, and set the value of theAppointment.InstanceTypeCodecolumn to Recurring Exception (choice value 3).Use the DeleteRequest class on the
Appointmenttable to delete a recurring appointment instance. Deleting an appointment instance marks it an exception by creating an entry for the instance in theRecurringAppointmentMaster.DeletedExceptionsListcolumn for the parent appointment series object.Use the CreateExceptionRequest class on the
Appointmenttable.
Convert an appointment to a recurring appointment
A recurring appointment is an appointment with recurrence information. You can convert an existing appointment in Dataverse 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
Update a recurring appointment
Sample: Sample: Create, retrieve, update, and delete a recurring appointment