Skip to main content

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.v22.2.Core.dll

NuGet Package: DevExpress.Scheduler.Core


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.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ForeignIdFieldName property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also