Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

c# AddTaxonomy Field Problem with SPList and Contenttype enabled

$
0
0

Hello,

i have a sharepoint list with contenttypes enabled.

When i add a taxonomy field programmatically, the field is added atomaticly to a contenttype.

how is this possible? In the standard mask where i can add a taxonomy field, i have the property/checkbox "Add to all contenttypes", but this is not possible in code behind

TaxonomyField _field = _list.Fields.CreateNewField("TaxonomyFieldTypeMulti", sInternalName) asTaxonomyField;

           _field.AllowMultipleValues = allowMultipleValues;

           _field.SspId = TermstoreID;

           _field.TermSetId = TermsetID;

           _list.Fields.Add(_field);

           _list.Update();


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>