none
Cannot remove description field after adding to the Custom List RRS feed

  • Question

  • Hello,

    Applies To: SharePoint 2013

    Problem: We created a Custom List and added a Description column from "Add from existing site columns" link. Now we need to remove it and it seems to have been sealed. We are not able to delete it. There is no remove/delete link/button when we click on the field. Moreover in the Content Type it only shows Required, Optional, Hidden.

    Requirement: Need to remove this field from the Custom List. Incidentally we added two of the description fields. We need to remove both of them without deleting the list itself.

    Thank you and

    Regards

    Tanzim Akhtar


    Tanzim Akhtar

    Saturday, March 9, 2013 10:36 AM

Answers

  • Hi Tanzim,

    Try the following code. I tested it and it should work for you.

    Add-PSSnapIn Microsoft.SharePoint.Powershell

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

    Remove-PSSnapIn Microsoft.SharePoint.Powershell

    Narahari

    ******If a post answers/helps your question, please click "Mark As Answer" on that post and/or "Vote as Helpful*******

    • Proposed as answer by B Narahari Patro Thursday, May 28, 2015 6:20 AM
    • Marked as answer by Tanzim Thursday, May 28, 2015 8:20 AM
    Wednesday, August 28, 2013 3:00 AM

All replies

  • Update: The field type of both were single line of text. I convert one of them to multiple line of text and the Delete button appeared. However as for the other Description field it is still single line of text and there are no options to make it multiple line of text.


    Tanzim Akhtar

    Saturday, March 9, 2013 10:51 AM
  • You could try to use Powershell to set the AllowDeletion property of the field to true, and then try to delete it:

    $list = $web.Lists["listname"]
    $field=$list.Fields["Description"]
    $field.AllowDeletion=$true
    $field.Update($true);

    Monday, March 11, 2013 5:39 PM
  • Thank you Christopher,

    I tried the code and it is giving some errors about syntax. I think am not writing the code properly.

    Can you please write the full code? For example $web should contain the URL to the web that contains this list, correct?

    Moreover I have renamed the field from Description to D1 so shall I refer to that name or internal name like "RoutingRuleDescription".

    Regards

    Tanzim Akhtar


    Tanzim Akhtar

    Tuesday, March 12, 2013 6:51 AM
  • That is odd I pretty much just copied my code right over

    Make sure to use the display name of the list

    And.. it may be choking on "Description" for the field, you might have to use the internal name, I put another way to get the field below using GetFieldByInternalName. To get the internal name you can just hover over the field in the list settings and you should see the internal name in the url.

    You can also delete the field directly using powershell. I'd try this on a test list first:

    $web = Get-SPWeb(yoururl) $list = $web.Lists["the displayname of the list"] $field=$list.Fields["Description"]

    #OR TRY:

    $field = $list.Fields.GetFieldByInternalName("the internal name of Description field")

    $field.AllowDeletion=$true $field.Update($true);

    $list.Fields.Delete("Description");

    $list.Fields.Update($true);

    $list.update();


     
    Monday, March 18, 2013 3:48 PM
  • Thank you Christopher,

    I tried the following:

    $web = Get-SPWeb("http://epm2013/sites/test")
    $list = $web.Lists["Cases"]
    $field=$list.Fields["Description"]
    $field.AllowDeletion=$true
    $field.Update($true)

    Result: Nothing appears after refreshing the page. There is no delete button to delete the said field.

    $web = Get-SPWeb("http://epm2013/sites/test")
    $list = $web.Lists["Cases"]
    $field = $list.Fields.GetFieldByInternalName("RoutingRuleDescription")
    $field.AllowDeletion=$true
    $field.Update($true)

    Result: Nothing appears after refreshing the page. There is no delete button to delete the said field.

    The last method i.e.

    $list.Fields.Delete("Description");

    $list.Fields.Update($true);

    $list.update();

    Gives error

    Regards


    Tanzim Akhtar

    Tuesday, March 19, 2013 8:07 AM
  • Same issue. Created a custom site column called Description with Single Line of Text. Added it to a Content Type. Unable to delete it / remove it from Content Type. Wonder if it had to do with naming it "Description" while creating it. Seems like a bug, i dont find a reason why this would happen.

    any answer to get rid will be greatly helpful.

    thx - tp

    Tuesday, August 27, 2013 6:58 PM
  • Hi Tanzim,

    Try the following code. I tested it and it should work for you.

    Add-PSSnapIn Microsoft.SharePoint.Powershell

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

    Remove-PSSnapIn Microsoft.SharePoint.Powershell

    Narahari

    ******If a post answers/helps your question, please click "Mark As Answer" on that post and/or "Vote as Helpful*******

    • Proposed as answer by B Narahari Patro Thursday, May 28, 2015 6:20 AM
    • Marked as answer by Tanzim Thursday, May 28, 2015 8:20 AM
    Wednesday, August 28, 2013 3:00 AM
  • Thank you so much for the post/answer ... after beating my head all day, your answer worked like a charm!

    Thanks again

    Thursday, January 8, 2015 4:43 PM