List Referential Integrity Solution

Rating: No reviews yet
Downloads: 104
Released: Mar 3, 2009
Updated: Mar 3, 2009 by ggalipeau
Dev status: Stable Help Icon

Recommended Download

Application List Referential Integrity Solution
application, 19K, uploaded Mar 3, 2009 - 104 downloads

Release Notes


The RDA List Referential Integrity Solution shows how to ensure basic referential integrity for SharePoint lists.


SharePoint users can create a relationship between lists using the Lookup field. For example: in the Employees list we can define the Department field as a Lookup into the Departments list using the field Title. To abbreviate this: Employees"Department" references Departments"Title". Now when the user is creating or modifying an entry in the Employees list, the Department field get a nice drop-down list of all Departments. There are two ways this can be broken. If there are two entries in the Departments list with the same Title, it is hard to tell which instance is referenced by the existing Employees entries. Also, it is possible to delete the referenced Department entry which leaves us with orphaned Employee entries.


RDA List Referential Integrity Feature to the rescue! Using this solution helps with both problems.

How it works

When activated, the Feature creates a list named ReferentialIntegrity. The activation code iterates through all lists on the site and adds entries to the ReferentialIntegrity list for all existing Lookup fields (i.e. there is one entry for each relationship between two lists). The code also creates and attaches List Event Receivers that monitor if Lookup fields are added to existing lists. Finally, the code creates and attaches Item Event Receivers that prevent users from adding/modifying/deleting list items if it would violate referential integrity by creating one of the problems mentioned above.

Installation Instructions

Install the .wsp solution using stsadm and deploy it to the web application of your choice using stsadm or the Central Administration UI.

Once deployed, the RDA List Referential Integrity is available in the Site Features section of the Site Settings.

Reviews for this release

No reviews yet for this release.