5 Comments on “Provisioning a Managed Metadata Column Programmatically–declaratively”

  1. SharePointG September 28, 2011 at 10:40 am #

    Great article Atul..Really helped me!

  2. camous December 6, 2011 at 12:31 pm #

    Great article, I struggled a lot of time on this issue.

    However, I would moderate your last Note regarding the fact to be in the same farm for having the same GUID reference (Managed Service, Group, Term Store, etc)

    I declared my TaxonomyFieldType field with just the TextField guid (referencing the hidden Note field)

    TextField
    {a336d7ee-486a-4e46-9886-94ee7497d3eb}

    After the deployment, you just “have” to update from UI in your new environment, which is acceptable in my situation.

  3. Arthur January 4, 2012 at 6:04 am #

    Cool article. But what about properties: FilterAssemblyStrongName, FilterClassName, FilterMethodName and FilterJavascriptProperty?

    When I try to override them in Customization of the Field element they’re not initialized with my values – SharePoint sets the default ones… bug?

  4. Arthur January 4, 2012 at 6:56 am #

    Oh, that’s sad. I won’t be able to assign this values. That what I’ve found in TaxonomyField.Update():

    public override void Update()
    {
    base.SetCustomProperty(“SspId”, this.SspId.ToString());
    base.SetCustomProperty(“AnchorId”, this.AnchorId.ToString());
    base.SetCustomProperty(“UserCreated”, this.UserCreated);
    base.SetCustomProperty(“Open”, this.Open);
    base.SetCustomProperty(“TextField”, this.TextField.ToString(“B”));
    base.SetCustomProperty(“IsPathRendered”, this.IsPathRendered);
    base.SetCustomProperty(“CreateValuesInEditForm”, this.CreateValuesInEditForm);
    base.SetCustomProperty(“TargetTemplate”, this.TargetTemplate);
    base.SetCustomProperty(“IsKeyword”, this.IsKeyword);
    if (!this.IsKeyword)
    {
    base.SetCustomProperty(“TermSetId”, this.TermSetId.ToString());
    base.SetCustomProperty(“FilterAssemblyStrongName”, Assembly.GetExecutingAssembly().FullName);
    base.SetCustomProperty(“FilterClassName”, base.GetType().ToString());
    base.SetCustomProperty(“FilterMethodName”, “GetFilteringHtml”);
    base.SetCustomProperty(“FilterJavascriptProperty”, “FilteringJavascript”);
    }
    else
    {
    base.SetCustomProperty(“TermSetId”, Guid.Empty.ToString());
    }
    base.Update();
    }

    Even if I assign them any call of the Update() method will override it. Damn…

Trackbacks/Pingbacks

  1. how to create managed metadata column in sharepoint 2010 programmatically | Share your knowledge - June 14, 2013

    […] http://sharepointx-men.com/2011/07/27/provisioning-a-managedmeta-data-column-programmaticallydeclara… […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 81 other followers

%d bloggers like this: