I have been making custom list definitions and list instances in Visual Studio. I was building and deploying the lists and noticed on the list details screen that the menu item "Delete this List" in list settings is missing.
Problem:
My mistake was to set Allow Deletion to false
<ListTemplate
Name="ListDefinition1"
Type="10001"
AllowDeletion="FALSE"
DisallowContentTypes="FALSE"
BaseType="0"
OnQuickLaunch="FALSE"
SecurityBits="11"
Sequence="410"
DisplayName="Equipment Booking"
Description="My List Definition"
Image="/_layouts/images/itgen.gif"/>
Once this is done you no longer see the "Delete this List" link in the list settings and is intended to protect lists with items declared as records.
Solution:
So how do you fix it. Not through the UI but with powershell
1.) Start > Programs > Microsoft SharePoint 2010 Products
2.) Select SharePoint 2010 Management Shell which opens a power shell session
3.) Punch in following script:
$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
source:http://webdevshareetc.blogspot.com/2012/01/sharepoint-2010-delete-this-list-link.html
No comments:
Post a Comment