Microsoft Office Tutorials and References
In Depth Information
Adding a Lookup Field
The Customer field for this list would be perfect as a lookup field. The user can only select from
existing customers in the Customer contact list, so they can’t mistype or make one up. It also
creates a nice connection between the Sales and Customer lists.
One shortcoming of lookup fields has been that often when someone needs to look up one
field from a list, they actually need information from more than one field in the same list. For
example, pulling the customer’s company name is useful in the Sales list, but it would be even
more useful to also have the contact and their phone number as well. And have them linked, so
if you choose a certain company, then the company contact and phone number would propagate
with the correct data corresponding to the company name.
And this version of SharePoint can do just that.
In addition, because there will now be a relationship between the two lists, you can indicate
what should happen in the target list (the list you are adding the lookup field to) if the record
is deleted from the parent list (the list that is being looked up): should it also delete the related
items in the target list, or should it throw up a warning not to delete that record because it has
associated records in other lists? This capability was decidedly lacking in the previous version
of SharePoint. And although it is rudimentary, it can be very useful.
TO HELP THE LOOKUP WORK BETTER
Just to give SharePoint an assist, consider, in the Customer list, setting whatever field you use for
the lookup to Enforce Unique Values so there won’t be any confusion if there are more than one
record with the same value.
1. To create the Customer field, click Create Column.
2. For the Column name, use Customer. Choose Lookup for the data type.
3. In the Additional Column Settings section, require that this column contain information.
Do not enforce unique values.
4. Also in that section, select Customers in the Get Information From field. This selects the
list that the lookup field will be accessing (Figure 7.40).
5. Choose Company as the column to which the lookup field will connect.
6. Do not check the box to allow multiple values, because there should be only one customer
per sales order. Allowing multiple selections would make it possible to choose more than
one company from the Customers list for each item in this list. Keep it in mind for other
lists you might make, but it’s not appropriate here.
Under Add A Column To Show These Additional Fields are the other fields available
in the Customers list (note that choice, calculated, or lookup fields don’t show up here)
to display in the list along with the lookup field. They are considered projected fields,
meaning the extra data is pulled for your viewing pleasure in this list, but the data they
contain is not saved in this list. These additional fields will be displayed with their field
name appended to the lookup field name by a colon (you’ll see in a moment). They also
will come immediately after their associated lookup field in the view, by default.