SharePoint 2010 Lists Improvements – List Lookups and Relationships

SharePoint 2010 brings in quite a few changes to Lists in SharePoint, especially in the lookup columns and enforcing relationships.

When you create a Lookup Column in SharePoint 2010 which fetches data from another List’s field, you can now add additional lookup fields and not just the identifier field!

image 

Along with adding additional lookup fields, you can also enforce relationships so that it allows a cascade delete or restricts delete if a relationship still exists:

image

So, if there is a relationship associated, then you get this lovely error message when you try to delete an item (relationship behaviour configured to Restrict delete):

image

A Powerful Example to showcase List Relationships

Well, there isn’t much if I just show you the new options in lookup fields and relationships. Here is an example to show how powerful the relationships are in SharePoint 2010!

Projects and Employees List

So, I have two lists Projects and Employees list:

image

image

As you can see the Projects list has a lookup field Primary Contact which links to the Employees Fullname field. And the Employees list has a lookup field Project referring to the Project Title field.

If you click on a Project item, you get to see the project details, which is obvious:

image

Now, I would also like to see all the employees associated with this project. Given that we already have linked Projects and Employees list, this is certainly doable. You would go about asking any of your developers to build a web part that would do this job. With SharePoint 2010, its just plain simple with few steps :)

All we need to do is edit the default display form and add the Employees list!

In the SharePoint Ribbon (when you are on the List page, click on List in the Ribbon), select to edit the default display form:

image

This is the form that displays when you view an item.

This will open the default display form page in edit mode. Notice that the Ribbon now has Insert tab. Click on Insert and you will find the Related List button!

image

You can see the Employees list listed there! As it says, inserting this related lists web part will display related Employees items based on the Project lookup column! Go ahead and insert the list:

Below is the display form page with the related list web part added:

image

Save the page, and now, clicking on a Project item, you can see all the Employees associated with that particular project!

image

That wasn’t hard! Now, this is what I call a ‘killer-feature!’ :)


Comments

Nov 09 Derek

Derek

I hope this control allows fields to be selected from the target list that are part of a BDC field.

As an example, if your employess list above had a BDC column that also fetched the access card number or some other value, and you then want to be able to select that as an additional field.

pingback

Pingback from jcgonzalezmartin.wordpress.com

SharePoint 2010: Integridad referencial en listas (I)! « Pasión por la tecnología…

Nov 11 Blog del CIIN

trackback

SharePoint 2010: Integridad referencial en listas (I)!

Otra de las novedades que incorpora SharePoint 2010 es la posibilidad de poder definir relaciones entre

Dec 09 Travis

Travis

Chaks' cool article.

Quick question.
Have you been able to get any additional field which aren't text fields?  I am tring to get Person or even a lookup from a related list.

May 01 Ben

Ben



Thanks for this.

Anyone have any thoughts on how to add a related/child record that will automatically be associated with the parent record?

Cheers,

FootBen

Jul 22 Venkat

Venkat

were you able to automatically associate child to parent record?

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading





Creative Commons License
Chaks' Corner Blog by Chakkaradeep Chandran is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Based on a work at www.chakkaradeep.com.
Permissions beyond the scope of this license may be available at http://www.chakkaradeep.com.