May 8, 2013

Error "This functionality is unavailable for fields not associated with a list" at SPField.Update()

Symptoms:

Sometimes it is necessary to modify your content type's property in a list without affecting to list items data.
The easiest way to do it is PowerShell:

$web = Get-SPWeb http://web-url
$list = $web.Lists["listName"]
$list.ContentTypes["CTName"].Fields["fieldName"].someProperty = someValue
$list.ContentTypes["CTName"].Fields["fieldName"].Update()
Oops. Error: “This functionality is unavailable for fields not associated with a list”


The reason:

SPField which is going to be modified belongs to Site Columns (SPWeb.Fields collection). Editing this SPField is unavailable.
SiteColumns are stored inside ContentTypes as FieldLinks, not as Fields.

The solution:

Use SPContentType.FieldLinks instead of SPContentType.Fields collection.
$web = Get-SPWeb http://web-url
$list = $web.Lists["listName"]
$list.ContentTypes["CTName"].FieldLinks["fieldName"].someProperty = someValue
$list.ContentTypes["CTName"].Update()
$web.Dispose()

Successfully completed without errors.

Mar 15, 2013

Jan 5, 2013

Windows Server 2012 is not supported by SharePoint 2010 until SharePoint SP2

Today I was really surprised.
SharePoint 2010 cannot be installed on Windows Server 2012 operating system.
The situation will be fixed only after releasing SharePoint 2010 Service Pack 2 which is even not announced yet.

Here is Microsoft KB article about it.

Hope SP2 will be released soon.


Update1:  It's funny but SharePoint 2010 is also cannot be installed on machines with Office 2013.