Tuesday, March 23, 2010

UserSelectionMode issue when extracting Person/Group field definitions in WSS 3.0/MOSS 2007

An issue exists when extracting Person or Group fields from SharePoint, specifically using SPSource but I'm guessing this issue transcends the use of SPSource due to the following article from http://support.microsoft.com/kb/934613.

The issue is that when you've extracted a field you may see an 'invalid' attribute value in UserSelectionMode="PeopleOnly". Basically this value should be 0 for people only as the schema defines this as an int. If you attempt to deploy a field definition in XML via Elements.xml you'll see the following error:

Feature definition with Id xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx failed validation, file 'ECM.SiteColumns\Columns.xml', line 17, character 98:

The 'UserSelectionMode' attribute is invalid - The value 'PeopleOnly' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:int' - The string 'PeopleOnly' is not a valid Int32 value.

ECM.wsp: The Solution installation failed.

The value for UserSelectionMode should be set to 0 for PeopleOnly or 1 for PeopleAndGroups. I haven't tested yet, but I wonder whether this would be valid if the field was provisioned programmatically using AddFieldAsXml() method. This would then yield consistent behaviour with the <Customization> child element bug discussed on the SharePointDev wiki @ http://sharepointdevwiki.com/display/public/SharePoint+Custom+Fields?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SharepointDevWiki+(SharePoint+Dev+Wiki+RSS+Feed)

No comments:

Post a Comment