Managed Metadata

rss

Posted by Jeff Childers - Dec 19 ’13 at 11:52

I need the ability to create and set managed metadata columns based on the value of an item in a form.  I notice that setting managed metadata is not included in your post on how to set field values.

Is this something that I can do with SPFORM or do I need to turn to spservices or something similar to do so?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 9 months 11 days
    #1 by Dmitry Kozlov Dec 22 ’13 at 12:16

    Hello Jeff,

    Thank you for your question. Please, try the following code to set Managed Metadata field:

     
    fd.field('Metadata').control()._el()
        .find('.ms-inputBox').html('Term 2');
    
    var metadata = new Microsoft.SharePoint.Taxonomy.ControlObject(
        fd.field('Metadata').control()._el().find('.ms-taxonomy').get(0));
    
    metadata.validateAll();
    

    Replace 'Metadata' with the internal name of your field in both places and 'Term 2' with the title of your term.

Displaying 1 to 1 of 1 messages