Sharepoint Delete Hidden Site Columns

the errors you might get:
"Cannot change Hidden attribute for this field"
"cannot delete hidden column"

reason: http://sadomovalex.blogspot.co.il/2012/01/avoid-cannot-change-hidden-attribute.html

solution: run this Poweshell:

$web = Get-SPWeb http://YourSite/YourWeb
$list = $web.GetList("/YourWeb/Lists/YourList")
$field = $list.Fields.GetFieldByInternalName("YourFieldInternalName")
$type = $field.GetType()
$mi = $type.GetMethod("SetFieldBoolValue",
    [System.Reflection.BindingFlags]$([System.Reflection.BindingFlags]::NonPublic -bor
    [System.Reflection.BindingFlags]::Instance))
$mi.Invoke($field, @("CanToggleHidden",$true))
$field.Hidden=$false
$field.Update()

$field.Delete()

Comments

Popular posts from this blog

OverTheWire[.com] Natas Walkthrough - JUST HINT, NO SPOILERS

Asp.Net Ending Response options, Response.End() vs CompleteRequest()

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem