SP2010: C#, SharePoint list and managed metadata.

Posted on 2012-09-17
Last Modified: 2012-10-11
Hello. I wrote a simple class that iterates through any given list. Nice but what about managed metadata? Is it possible to know if the field in question is a taxonomy field? Apparently there is no field type for managed metadata ( Edit: Taxonomy fields are Lookup columns. Seem that all I need to to is to get all values from this field.
Question by:tolppa
    1 Comment
    LVL 15

    Accepted Solution

    Include a reference to: Microsoft.Sharepoint.Taxonomy.dll

    Add the following using directive:
    using TaxonomyField = Microsoft.SharePoint.Taxonomy;

    Open in new window

    You can now use this on your fields, eg:

     SPList myList= currentWeb.Lists["My List Name"];
    TaxonomyField myTaxonomyField= myList.Fields["My field name"] as TaxonomyField;
    if(myTaxonomyField == null)
    {//Not a taxonomy field
    {// Deal with the taxonomy field here

    Open in new window


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    What are the big features of MVC5? 4 34
    multidimensional array 4 19
    Aspnet xml 2 27
    Problem to event 3 28
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now