5

I activated the community feature on 1 site. For some reasons, the Topics list does not have subject column although everything else works fine. So, I decide to remove everything and deactivate/activate the feature. But, I could not delete the list. When I delete the "Community Members" list, it shows:

You cannot send this list to the site Recycle Bin. This list has the following related List [Discussions List]

If I remove the Discussions List, it shows error:

You cannot send this list to the site Recycle Bin. This list has the following related List [Community Members]

In the list, there are some lookup column. However, for some reasons, I could not delete them. Anyone knows how to deal with this?

Thanks

3
  • Delete the data first, than the lookup columns and than the lists.. It should work this way.. Or just update the lookups to not set restriction for deleting or any kind of relationship.. Commented Apr 27, 2014 at 21:29
  • for some reasons, it does not work. For example, Discussions List does not have any data, but when I remove it, it shows: You cannot send this list to the site Recycle Bin. This list has the following related List [Community Members], although there is data in [Community Members].
    – urlreader
    Commented Apr 27, 2014 at 21:58
  • and in [Community Members], it only has 1 member which is the account who created the list, and it does not allow to remove it.
    – urlreader
    Commented Apr 27, 2014 at 21:59

6 Answers 6

3

I confirm that the procedure sketched by Arsalan Adam Khatri in the comments works for me (in ShPt2010):

  • Delete the data first,
  • then the look(ed)up columns (List Settings from the ribbon, then in the Columns all columns of type Lookup, if you are not sure, which is the problematic one.).
  • Finally delete the whole list.

Alternatively, you can loosen the restriction for a given looked-up column in its section Relationship: uncheck "Enforce relationship behavior".

1

I know this is an old question, but I too stumbled across this problem this past week. The above answers were helpful but not complete. I dug into it more and believe I have a script that fully cleans everything up.

$web = "https://sp.domain.com/sites/erictest126"

# The Web
$spweb = Get-SPWeb $web

$communityFeatureVisibleInUI = "961d6a9c-4388-4cf2-9733-38ee8c89afd4" 
$communityFeatureHiddenInUI = "4326e7fc-f35a-4b0f-927c-36264b0a4cf0"
# Disable the Community Site feature
if(Get-SPFeature -Identity $communityFeatureVisibleInUI -Web $spweb.Rootweb.Url -ErrorAction SilentlyContinue){
    Write-Host "Deactivating Community Site Feature on" $web
    Disable-SPFeature -Identity $communityFeatureVisibleInUI -Url $web -Confirm:$False
}

# The lists
$badgeList = $spweb.Lists["Badges"]
$categoriesList = $spweb.Lists["Categories"]
$membersList = $spweb.Lists["Community Members"]
$discussionsList = $spweb.Lists["Discussions List"]
$abuseList = $spweb.Lists["Reports List"]
$sitePages = $spWeb.Lists["Site Pages"]

# Holding arrays
$communityPages = @()
$communityMembers = @()
$discussionsFields = @()
$membersIndexes = @()
$discussionsIndexes = @()

# Disable Content Types on lists
$membersList.ContentTypesEnabled = $false
$membersList.Update()
$discussionsList.ContentTypesEnabled = $false
$discussionsList.Update()
$abuseList.ContentTypesEnabled = $false
$abuseList.Update()

# Find the feature generated pages
foreach($page in $sitePages.Items){
    if($page.Name -eq "Community Home.aspx" -or $page.Name -eq "About.aspx" -or $page.Name -eq "Topic.aspx" -or $page.Name -eq "Category.aspx" -or $page.Name -eq "Categories.aspx" -or $page.Name -eq "Members.aspx"){
        # Add it to the communityPages array, the item cannot be deleted from the collection proper
        $communityPages += $page
    }
}

# Delete the community pages
foreach($communityPage in $communityPages){
    $communityPage.Recycle()
}

# Find any created Community Members
foreach($cm in $membersList.Items){
    # Add it to the communityPages array, the item cannot be deleted from the collection proper
    $communityMembers += $cm
}

# Delete the created members
foreach($member in $communityMembers){
    $member.Recycle()
}

# Remove the hidden Badge list, this is the easiest to remove
$badgeList.AllowDeletion = $true
$badgeList.Update()
$badgeList.Delete()

# Remove the Categories List
$categoriesList.AllowDeletion = $true
$categoriesList.Update()
$categoriesList.Delete()

# Remove the Reports List
$abuseList.AllowDeletion = $true
$abuseList.Update()
$abuseList.Delete()

# Column fixup
$BadgeColumn = $membersList.Fields.GetFieldByInternalName("GiftedBadgeLookup")
$BadgeColumn.AllowDeletion = $true
$BadgeColumn.Sealed = $false
$BadgeColumn.Delete()

$discussionDependantColumns = @("AbuseReportsCommentsLookup","AbuseReportsReporterLookup","AuthorGiftedBadgeLookup","AuthorLastActivityLookup","AuthorMemberSinceLookup","AuthorMemberStatusIntLookup","AuthorNumOfBestResponsesLookup","AuthorNumOfPostsLookup","AuthorNumOfRepliesLookup","AuthorReputationLookup")
foreach($discussionDependantColumn in $discussionDependantColumns){
    $LookupColumn = $discussionsList.Fields.GetFieldByInternalName($discussionDependantColumn)
    $LookupColumn.AllowDeletion = $true
    $LookupColumn.Sealed = $false
    $LookupColumn.Delete() 
}

# Now the lookup column can be deleted
$ReportColumn = $discussionsList.Fields.GetFieldByInternalName("AbuseReportsLookup")
$ReportColumn.AllowDeletion = $true
$ReportColumn.Sealed = $false
$ReportColumn.Delete()

$MemberLookupColumn = $discussionsList.Fields.GetFieldByInternalName("MemberLookup")
$MemberLookupColumn.AllowDeletion = $true
$MemberLookupColumn.Sealed = $false
$MemberLookupColumn.Delete()


# Deletes the Members column
$MemberColumn = $membersList.Fields.GetFieldByInternalName("Member")
$MemberColumn.AllowDeletion = $true
$MemberColumn.Sealed = $false
$memberColumn.EnforceUniqueValues = $false
$memberColumn.Indexed = $false
$MemberColumn.Delete()

# Delete community members list indicies
foreach($listIndex in $membersList.FieldIndexes){
    $membersIndexes += $listIndex.Id
}

foreach($index in $membersIndexes){
    $membersList.FieldIndexes.Delete($index)
}

$membersList.AllowDeletion = $true
$membersList.Update()
$membersList.Delete()


foreach($listIndex in $discussionsList.FieldIndexes){
    $discussionsIndexes += $listIndex.Id
}

foreach($index in $discussionsIndexes){
    $discussionsList.FieldIndexes.Delete($index)
}

# Discussions List column fixup
$Categories = $discussionsList.Fields.GetFieldByInternalName("CategoriesLookup")
$Categories.Indexed = $false
$Categories.AllowDeletion = $true
$Categories.Sealed = $false
$Categories.Delete()

# Finally delete the Discussions List
$discussionsList.AllowDeletion = $true
$discussionsList.Update()
$discussionsList.Delete()

# Disable the hidden Community Site feature, cleans up content type
if(Get-SPFeature -Identity $communityFeatureHiddenInUI -Site $web -ErrorAction SilentlyContinue){
    Write-Host "Deactivating Community Site hidden feature on" $web
    Disable-SPFeature -Identity $communityFeatureHiddenInUI -Url $web -Confirm:$False
}

Just swap out the url in the first line with your affected site and it should clean up all the garbage.

https://ericjalexander.com/blog/2019/06/27/Removing-Community-Site-Feature

0

I did it with powershell. My list names is in Swedish, so you need to change it to your languange:

    $list = $spweb.Lists["Märken"] #badge list
    $list.AllowDeletion = $true
    $list.Update()
    $list.Delete()

    $list = $spweb.Lists["Kategorier"] #categoires list
    $list.AllowDeletion = $true
    $list.Update()
    $list.Delete()

   $list = $spweb.Lists["Community-medlemmar"] #members list

   $BadgeColumn = $list.Fields.GetFieldByInternalName("GiftedBadgeLookup")
   $BadgeColumn.AllowDeletion = $true
   $BadgeColumn.Sealed = $false
   $BadgeColumn.Delete()

After this, go to the Diskussion-list and remove all column index (/Lists/Community-discussion/ --> list settings --> indexed columns). Then go on with:

     $list = $spweb.Lists["Diskussionslista"] #discussion list
     $Categories = $list.Fields.GetFieldByInternalName("CategoriesLookup")
     $Categories.Indexed = $false
     $Categories.AllowDeletion = $true
     $Categories.Sealed = $false
     $Categories.Delete()

     $list = $spweb.Lists["Community-medlemmar"] #members list

     $list.AllowDeletion = $true
     $list.Update()
     $list.Delete()

    $list = $spweb.Lists["Diskussionslista"] #discussion list
    $list.AllowDeletion = $true
    $list.Update()
    $list.Delete()
0

Delete the list columns individually using SharePoint Designer. For both the lists. In case you arent able to delete the column, in any of the lists due to lookup link, delete its related columns in other list.

Once the list does not have any columns you will be able to delete them

0

For anyone facing this issue - the simple way to delete any list/library that has any dependency on some lookup list is to go to the column settings page and uncheck the "Relationship" check box (the one that has 'Restrict delete' & 'Cascade delete' relationship options under it). This will remove any relationship between that column and the lookup list, hence you can go ahead and delete this list (and lookup list as well if you need to).

0

It's actually much easier. Here's how I did it:

  • Go to list settings
  • Search for column(s) type "Lookup" (there may be several such columns if you have multiple connections)
  • Scroll to the bottom and remove checkmark for "Enforce relationship behavior" option
  • You can now delete the list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.