views:

614

answers:

2

I have a custom list, and I've added a 'Page Image' field by clicking on the 'Add from existing site columns' link on the Settings page for the list. I would now like to remove the field, but clicking on the field name on the Settings page yields no 'Delete' functionality.

How do you remove fields from a custom list in SharePoint that have been added via the 'Add from existing site columns' menu item?

A: 
  1. Go to "Advanced Settings" within the settings page for your document library.

  2. In the radio field "Allow management of content types", click "Yes" and go back to the document library settings

  3. Under a new section called "Content Types," click "Document"

  4. Click the field you wish to remove; and you should see a "Remove" Button.

Gurdas Nijor
I followed your instructions up until step 3 - it's a custom list, not a Document Library, so I see 'Item' as the only thing listed under 'Content Types', not 'Document'. Clicking on Item yields the list of fields as expected though. When I click on the field I want to remove, however, the only options are 'Required', 'Optional' and 'Hidden' - there's no 'Remove' button. Unfortunately 'Hidden' is not sufficient for my purposes. Any other ideas?
Ryan Shripat
The only other option I could think of would be to use the object model to get at the content type and pull the extra field off programatically.
Gurdas Nijor
+1  A: 

"Page Image" is a special kind of SharePoint field defined as Sealed. This means it cannot be removed from the UI once added. However it can be removed programmatically:

SPList list = web.Lists["CustomTest"];
SPField f = list.Fields["Page Image"];
f.Sealed = false;
f.Update();
list.Fields["Page Image"].Delete();

For reference, the field is defined in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingResources\PublishingColumns.xml.

Alex Angas
@Alex Angas: thanks!
Ryan Shripat