Skip to main content

SchedulerStorageBase.SynchronizeOutlookWithStorage(String) Method

Updates MS Outlook’s Calendar entries with appointments from the Scheduler storage.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.1.Core.Desktop.dll

NuGet Package: DevExpress.Scheduler.CoreDesktop

Declaration

public virtual void SynchronizeOutlookWithStorage(
    string outlookEntryIdFieldName
)

Parameters

Name Type Description
outlookEntryIdFieldName String

A String that is the name of the data field which contains the Outlook Entry ID value.

Remarks

The SynchronizeOutlookWithStorage method synchronizes the contents of MS Outlook’s Calendar with data from the storage. After synchronization, MS Outlook’s Calendar will contain a copy of the storage’s appointments. If a specific appointment in the Calendar does not match an appointment in the storage, it will be deleted.

Every appointment in MS Outlook’s Calendar has a unique identifier. To allow data to be synchronized between the storage and MS Outlook’s Calendar, add a string field to the database which stores appointments for the scheduler control. This field will contain Outlook entry IDs, and it will be automatically populated during synchronization. The method’s outlookEntryFieldName parameter specifies the name of this field.

Note

WARNING: If you call the SchedulerStorageBase.SynchronizeOutlookWithStorage method, all data in your MS Outlook will be lost. We suggest that you backup all your data prior to running this example.

Before synchronizing the SchedulerStorage with MS Outlook, create an additional field in your database. This field should be of the string type with a length of at least 50 characters, and intended to store the Outlook Entry Id for each appointment that is to be synchronized. Assuming the field is called “OutlookEntryId”, you can then use the following code to synchronize the Scheduler Storage with MS Outlook and vice versa.

schedulerControl1.Storage.SynchronizeOutlookWithStorage("OutlookEntryId");

For this example to work correctly, the Scheduler’s data source should provide a field to store the Outlook Entry ID. The filed should be mapped to a custom appointment field, as illustrated below.

schedulerStorage.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("OutlookId", "OutlookEntryId"));

Note

If your task is to combine all data from the SchedulerStorage and MS Outlook, use the SchedulerStorageBase.ExportToOutlook and SchedulerStorageBase.ImportFromOutlook methods instead. To set custom rules when synchronizing appointments, use the AppointmentExportSynchronizer and the AppointmentImportSynchronizer classes.

See Also