This next exercise uses two standard lists in a SharePoint 2010 Team Site: the Calendar list and the Tasks list. The goal of this example is to show the basic capabilities of the lookup column using a business example where a department tracks tasks using a Tasks list, and has weekly meetings that are managed in the Calendar list. The manager wants to use SharePoint to make the meeting more productive and wants to use the lookup column to pull additional information from the Tasks list into the Calendar list.
Consider the possibility that the Tasks list might have different permissions configured than the Calendar list. For example, on this site, the administrator may only allow project managers to edit the Calendar list, whereas all departmental employees can add to the Tasks list.
Before jumping into the example, some information about the functionality and limitations of the lookup column should be provided. To begin with, only certain column types are available to lookup columns. The following list shows the supported column types:
• Single Line of Text
• Date and Time
• Calculated
If other column types exist in the list that is being connected to with the lookup column, they will not be available for selection. This limitation should be kept in mind when planning for the use of lookup columns.
Exceeding eight lookup columns per list view consumes a large amount of SQL resources, which can result in performance degradation when the view is rendered. Although there can be more than eight lookup columns in the list, make sure to limit the number that are included in specific views.
Follow these steps to learn more about the lookup column’s functionality:
Flags
, and select Single Line of Text as the column type. Leave the other fields on their default values and click OK to save.• Title—
Enter Lookup Task 1
• Status— Not Started
• % Complete—
Enter 0%
• Assigned To— Enter a sample username
• Start Date— Enter a sample start date in the future
• End Date— Enter a sample end date that is after the start date
• Flags—
Enter Scope of work not clear
Leave the other fields with the default values. Click Save when the data has been entered.
• Title—
Enter Lookup Task 2
• % Complete—
Enter 10%
• Assigned To— Enter a sample username
• Start Date— Enter a sample start date in the past
• End Date— Enter a sample end date in the future
• Flags—
Enter Team lead is on vacation
Leave the other fields with the default values. Click Save when the data has been entered.
Figure 22.11. Tasks list with sample tasks to use in a lookup column.
Task Lookup
as the title of the column, and then click Lookup (information already on this site).Figure 22.12. Settings for the lookup column in the Calendar list.
• Title—
Status Meeting
• Location—
Meeting Room A
• Start Time—Enter a date and time in the next week
• End Time—Enter a date and time one hour after the start time
• Task Lookup—Click Lookup Task 1 and click the Add button; then click Lookup Task 2, and click the Add button.
Leave the other fields at their defaults and click Save.
Figure 22.13. Calendar event with lookup data values.
Task % Complete
and click OK. Note that the name of the column is now changed without breaking the functionality of the column. So, the administrator can make these lookup column titles more user friendly than the default names that are assigned.An additional option provided in a lookup column is to Enforce Relationship Behavior. While experimenting with this functionality, it is not unusual to see a message display that states “This lookup field cannot enforce a relationship behavior because this list contains incompatible fields.” The following example provides a case where Enforce Relationship Behavior can be tested.