Writing to columns based on the Managed Metadata field type is a little
different from writing to columns of other types. First, get a reference to the column in the
list, and then call the SetFieldValue() method to update the value of a specific list item, as
shown in the listing below:
ListselectedTerms = new List (); selectedTerms.AddRange(terms.ToList());TaxonomyField locationTags = listItem.Fields["Location Tag"] as TaxonomyField;locationTags.SetFieldValue(listItem, selectedTerms);listItem.Update();
No comments:
Post a Comment