Tuesday, April 22, 2014

Provisioning Managed Metadata (Taxonomy) Fields through CAML in SharePoint 2010

Hey guys,

The requirement was to provision a List trough CAML with some metadata columns associated to a specific Managed Metadata Service.

Things was the customer wanted to use the features as a template so NO CODE approach has been decided.

This tasks give me a tough time as there was no help available in the net as in all the blogs written for creating a Managed Metadata field were associating the fields using a Feature Receiver - that means using code.

What I did is that within a Team Site, I created a dummy list where I created the required fields and associate them to the specific Managed Metadata Service.

Once done, I saved the Site as a Template and downloaded the Wsp solution from the Solution Gallery.

Now using Visual Studio 2012 (thanks to VS2012), while creating a project it gives an option to create a solution from a Wsp Solution so here we go !!!

There after the project loaded successfully, I looked into the dummy list and copied the schema associated into it and pasted into my custom list schema and VOILA ! The list was provisioned with the managed metadata field associated to the MMS.

note that in case if you don't have Visual Studio 2012, you can still rename the wsp solution into a .CAB file and look for the schema of the dummy list but without intellisense...

No comments:

Post a Comment