SPS2010 : Field cannot be made again visible if defined to be hidden using Visual Studio 2010
During last weeks I encountered in a service request the behavior that after using Visual Studio to make a column hidden the column itself could not be made again visible disregarding of method. The field was created by following https://msdn.microsoft.com/en-us/library/ee231593.aspx#BKMK_CreatingCustSiteCols and adding inside the field definition "Hidden="TRUE".
Methods that we tried to change the hidden attribute back to FALSE were PowerShell and also SharePoint Manager but when updating for example using PowerShell the below message was presented.
The reason for which the field could not be made visible again is the fact that the CanToggleHidden atribute was set to false as seen in the screenshot when creating the field as hidden using the above method. CanToggleHidden field property is true if the column can be hidden, otherwise, false. (https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.cantogglehidden.aspx).
This behavior has been presented to the product group and is currently under investigation. I will update this post once the product group has provided more information.
To workaround the issue you can :
a) Change the field definition inside Visual Studio as shown below and then redeploy from Visual Studio the solution.
b) Create the field inside Visual Studio without specifying neither Hidden and neither CanToggleHidden. After the field is created use PowerShell to set the hidden property to TRUE
$field = $web.fields | ? { $_.InternalName –eq „PatientName1“ }
$field.hidden = $true
$field.update()
c) The CanToggleHidden value can be changed using Powershell only using reflection which is not supported and I saw that on the internet there are a couple of people that provide the PowerShell script but once again to be on the supprted safe side please open a service request to Microsoft support. I don't see thus any reason why to go for this method as the above methods cover each situation, when the field is allready present and when not.