Changing SharePoint Read-Only fields (possibly created by InfoPath)
When you publish an InfoPath form to a list or library, you may notice that some of the columns become “locked” or “hidden” from some views becoming SharePoint Read-Only fields. In the Publishing Wizard for the InfoPath form there is an option on each column called “Allow users to edit data in this field by using a datasheet or properties page”. By default this option is not checked. Therefore each column will be set to “Ready Only” in SharePoint. You can re-run the Publish step (not the quick publish), change the option and the field will update appropriately, but what if you want to unlock the column without InfoPath.
For this example we had created a source library using InfoPath as a source document, we did want to lock down a couple fields so the users couldn’t modify them outside of the form. But when the document had finished its workflow, we wanted to put it in an archive library. We exported the original document library as a template and then imported it on the archive site. Lo and behold, it brought over all of the read only attributes for the locked down fields. We actually wanted to delete some of these fields and tidy up a bit. It turns out that you can’t (today) do this with Designer, you need to drop to PowerShell. Because we had multiple fields, we built a simple array so we could knock it out in one fail swoop.
Make sure you run this on the server hosting this web app & list.
$spweb = Get-SPWeb http://YourSharePointServer/site/YourSite
$list = $spweb.Lists[“Name of Your List”]
$columns = “Field One”,”Field Two”,”Field Two”, “Field Three”
foreach ($column in $columns)
$field = $list.Fields[$column]
$field.ReadOnlyField = $false