none
Unable to Delete Site Column RRS feed

  • Question

  • Hi,

    We have a bunch of content types syndicated from a Content Type hub. The columns in the content types were created using a feature on  the content type hub and published from there.

    On one of our site collections, somehow, some of the columns used in our content types have been created with different Id's. The result of this is that the Content Type hub can't publish to this site due to the conflict.

    The columns on the problem site collection do not have the "Delete" button visible. If I query the column in PowerShell it has the AllowDeletion property set to "False". If I try and change this to "True" using the following commands:

    $site = Get-SPSite http://siteurl
    $web = $site.RootWeb
    $field = $web.Fields["Field Name"]
    $field.AllowDeletion = "True"
    $field.Update()

    When I query the column again it hasn't saved and AllowDeletion is set back to false.

    I did actually manage to delete the columns in a dev environment by following the instructions in this blog. And this actually fixed my issue and I was able to get the content types syndicating again. However as this involves running a SQL query against a SharePoint database, I'm obviously not going to try that in production.

    Anyone able to help? Obivously needs to be a supported PowerShell method rather than using SQL. I've had a ticket open with Microsoft for about a month and they haven't been able to solve it yet...

    Wednesday, December 2, 2015 2:16 AM

Answers

  • Ended up having to log a call to Microsoft to get a SQL query to fix this.

    Note: don't do this yourself, get a Microsoft support call or you invalidate your farms support

    • Marked as answer by monkeymaj1k Thursday, April 28, 2016 5:15 AM
    Thursday, April 28, 2016 5:15 AM

All replies

  • Hi,

    Try the following:

    $web = Get-SPWeb "Web URL" 
    $list = $web.Lists["List Name"] 
    $field = $list.Fields["Description"] 
    $field.AllowDeletion = $true
    $field.Sealed = $false
    $field.Delete() 
    $list.Update()

    Was marked as the solution in this thread: https://social.technet.microsoft.com/Forums/office/en-US/9debb420-8955-475b-aef1-8d51bd67415e/cannot-remove-description-field-after-adding-to-the-custom-list?forum=sharepointgeneral

    Cheers,

    Grant.

    Wednesday, December 2, 2015 2:38 AM
  • Yeah tried that. It seems like it works and then after you update "AllowDeletion" is still false.
    Thursday, December 3, 2015 12:57 PM
  • Ended up having to log a call to Microsoft to get a SQL query to fix this.

    Note: don't do this yourself, get a Microsoft support call or you invalidate your farms support

    • Marked as answer by monkeymaj1k Thursday, April 28, 2016 5:15 AM
    Thursday, April 28, 2016 5:15 AM