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.v24.2.Core.dll
NuGet Package: DevExpress.Scheduler.Core
Declaration
Property Value
Type | Description |
---|---|
String | A String representing the name of the field containing the Foreign Id. |
Remarks
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.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ForeignIdFieldName property.
Note
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.