Custom Fields

You can define any number of mappings to data source fields that are not used by the Scheduler itself. The content of these fields is available via the PersistentObject.CustomFields property of the Appointment, Resource, and Label objects.

To bind a data field ("CustomField1") to the appointment custom field ("MyNote"), use the following code:


this.schedulerDataStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("MyNote", "CustomField1")); 
IMPORTANT

Names of data fields mapped to the resource or appointment properties must be unique.

You can also use the Mappings Wizards to create custom field mappings.

To access "MyNote" data for the selected appointment, use the following code:


object note = schedulerControl1.SelectedAppointments[0].CustomFields["MyNote"];

Custom Field Mappings should not use names from the list of the standard object properties (for instance, "StartDate" for appointments) if the Scheduler operates in unbound mode. For example, the following mapping may result in incorrect appointment processing:


AppointmentCustomFieldMapping customNameMapping = new AppointmentCustomFieldMapping("MyCustomIdField", "Id");
schedulerDataStorage.Appointments.CustomFieldMappings.Add(customNameMapping);

because "Id" is the name of the standard appointment property.