SharePoint taxonomy term sets can be open, allowing users to enter new values in the taxonomy picker. For this to work you also need to enable Allow ‘Fill-in’ choices in the site column settings for the managed metadata field connected to the term set. It took me a while to figure out how to enable this programatically using the client side object model (CSOM). The trick is to first cast the field to a TaxonomyField so you can edit the taxonomy specific properties on the field:
1 2 3 4 5 6 7 8 |
Field field = clientContext.Site.RootWeb.Fields.GetById(new Guid(taxGuid)); TaxonomyField taxField = clientContext.CastTo<TaxonomyField>(field); clientContext.Load(taxField); clientContext.ExecuteQuery(); taxField.Open = true; taxField.CreateValuesInEditForm = true; taxField.Update(); clientContext.ExecuteQuery(); |