AppointmentSynchronizer.ForeignIdFieldName Property

Gets or sets the field name that contains the Foreign ID in the third-party scheduling application (MS Outook) database with which appointment data is exchanged.

Namespace: DevExpress.XtraScheduler.Exchange

Assembly: DevExpress.XtraScheduler.v21.1.Core.dll


public string ForeignIdFieldName { get; set; }

Property Value

Type Description

A String representing the name of the field containing the Foreign Id.


MS Outlook synchronization uses the OutlookImportSynchronizer and OutlookExportSynchronizer classes, derived from the AppointmentSynchronizer class. Before calling the AppointmentSynchronizer.Synchronize method, you can specify the location of the calendar folder and the name of the database field to store the MS Outlook identifier of an imported event.

The calendar folder name is accessible via the CalendarFolderName property, and can be left empty. In this situation, the default Outlook calendar is used. You can get a list of calendar folders via the DevExpress.XtraScheduler.Outlook.OutlookExchangeHelper.GetOutlookCalendarFolders method.

The ForeignIdFieldName property enables you to specify the data field name intended to hold a foreign (MS Outlook) appointment identifier. This is important, because during synchronization an appointment in the Scheduler storage is matched with the corresponding MS Outlook event using this identifier. The database field can have any name (e.g. “OutlookEntryID”) and should be able to hold a long sequence of characters (e.g. nvarchar(256) in MS Access).

To get the foreign ID of an appointment for your purposes, you can utilize the IGetAppointmentForeignId interface in the AppointmentSynchronizer.AppointmentSynchronized event handler:

void synchronizer_AppointmentSynchronized(object sender, 
    DevExpress.XtraScheduler.AppointmentSynchronizedEventArgs e)
        object outlookID = ((IGetAppointmentForeignId)sender).GetForeignId(e.Appointment);

Another way to obtain the foreign appointment ID is to handle the AppointmentExchanger.GetAppointmentForeignId event.

See Also