Exploring “Enforce Relationship Behavior” option for SharePoint Lookup Column

In SharePoint we can use values of one list as lookup values in another list. Sometimes it is required to setup the relation between two lists so that deleting an item in lookup list restrict or allows delete in referenced list.

For a SharePoint column, we can use “Enforce Relationship Behavior” property to achieve this. Lets see how it works-

I have a list “Countries” with only one default “Title” column. I have another “Requests” where “Country” is a lookup column to “Countries” list. Lets go to the settings of “Country” column, scroll down to “Relationship” section and check “Enforce Relationship Behavior”.

Relationship

Here we have two options, let see what each one does-

  • Restrict Delete – If this option is selected, and user tries to delete an item in “Countries” list. If this item is being used by any item in “Requests” list, user will get error message “This item cannot be deleted because an item in the “Requests” list is related to an item in the “Countries” list.“, else item will be deleted.

RestrictDelete

  • Cascade Delete – If this option is selected, and user tries to delete an item in “Countries” list. If this items is being used by an item in “Requests” list, user will get confirmation message – “Sending this item to the site Recycle Bin will also send any related items in the following lists to the site Recycle Bin: [Requests]. Are you sure you want to send the item(s) to the site Recycle Bin?“, else item will be deleted.

CascadeDelete

 

So select the correct option as per your requirement.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s