Monday, January 30, 2012

Sharepoint 2010 - Delete this List link missing

If menu item "Delete this List" in list settings is missing or, in Sharepoint Designer 2010, you receive error in deleting list/library, may be problems is for AllowDeletion property of the List/Library.

Once you declare an item as a record in a list, the corresponding lists SPList.AllowDeletion property is set to False. This is why you no longer see the "Delete this List" link in the list settings and is intended to protect lists with items declared as records.

You can use PowerShell to delete the list (using the SharePoint 2010 Management Shell):

$assignment = Start-SPAssignment
$web = Get-SPWeb -Identity "http://yoursite" -AssignmentCollection $assignment
$list = $web.lists["Your List Title"]
$list.AllowDeletion = $true
$list.Update() #after this is entered, the "Delete this List" link will reappear in the UI for the List Settings
$list.Delete() #this will delete the list
Stop-SPAssignment $assignment

Yes, it's works.