In this article we will be seeing a new feature called Referential Integrity in SharePoint 2010. I have created two lists "ParentList" and "ChildList". In the "ChildList" I am creating a lookup column which will take values from "ParentList". When you create a lookup column you can see "Relationship" where you can maintain referential integrity enforcing the relationships defined by lookup columns. Just like foreign key constraints in a relational database, in SharePoint 2010 you can configure restrict delete and cascade delete rules on lookup column relationships:
Cascade delete: When an item in the target list is deleted, cascade delete will delete all related items in the list. For example in the parent list I have the following items And in the child list I have the following items I have chosen "Cascade delete" and when I try to delete an item "Java" from the "ParentList" a message will pop up It will delete all the items related to the list. Once you delete the "Java" item in the parent list, the child list looks like the following. Restrict delete: It will prevent the deletion of an item in the target list if it has one or more related items in the list. When you try to delete an item in the parent list you will be getting the following error message
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: