SuperOffice.CRM.Entities.AppointmentMatrix is a matrix holding information about repeating appointments and their attendees.
In the following example, we will be creating an appointment at 2.00 P.M. tomorrow that will recur for the next 8 working days.
Code
Walk-through
First, we have created the appointment that should recur, using theCreateNew method exposed in the Appointment entity. The appointment text is set next, followed by setting the contact, appointment type, and status for the appointment.
Next, we have created the appointment matrix passing the appointment to recur.
In creating recurring appointments the most important part is setting the recurrence information. This is done by creating a recurrence pattern. In this example, the pattern is as such the appointment should recur daily for 8 days starting from tomorrow. Thus the recurrence pattern is set to Daily and further specified as EveryWorkday. The RecurrencePattern and RecurrenceDailyPattern are enumerations.
Next, we have set the start and end dates for the repetition pattern. Using the CalculateDays method the days for the recurrence pattern are created.
Finally, the recurrence information is assigned to the matrix and the matrix is saved to the database.
Get the source code (zip)