Managed Metadata Fields in SP2010 Content Type Definitions

30 April 2011

I've been creating some content types in SharePoint 2010 recently, which include a few of the new Managed Metadata Fields, and I came across an issue where items created with the content type wouldn't save, and would leave the following error message:

Failed to get value of the “{0}” column from the “Managed Metadata” field type control. See details in log. Exception message: Invalid field name. {00000000-0000-0000-0000-000000000000}

To the rescue is Ari Bakker, and a fantastic blog post about exactly what you need to do, which you can find in its entirety here - definitely worth a read.

If you just want to skip to the fix, you need to add a Hidden Note field and associate it to your Managed Metadata Column. This is where SharePoint stores the text value of the selected tag, which explains the error message, a little. To do so, just create a hidden field:

<Field Type="Note"
      DisplayName="Type Of Document_0"
      RowOrdinal="0" />

And add it to your content type using a as per usual. And finally, you'll need to tell the managed metadata field where this Note field lives:

  <Field Type="TaxonomyFieldType" DisplayName="Type Of Document" ID="{79FB1D5E-FACF-4F12-9871-9B68D8623974}" ShowField="Term1033" Group="Custom Columns" StaticName="Type_x0020_Of_x0020_Document" Name="Type_x0020_Of_x0020_Document">
          <Value xmlns:types=""

There's a few other values for the customization array, which you can find if you grab the sourceXml for a managed metadata site column created on site - I recommend SharePoint Manager 2010 to easily take a look at it.

Tags: content type, managed metadata, SharePoint 2010, SharePoint, site column

Add a Comment

No Comments