Export (0) Print
Expand All

TaxonomyField.SetFieldValue Method (SPListItem, ICollection<Term>)

Sets the value of the corresponding multi-value field in the list item to the properties of the T:Microsoft.SharePoint.Taxonomy.Term objects in the specified collection.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)

public void SetFieldValue(
	SPListItem item,
	ICollection<Term> terms
)

Parameters

item
Type: Microsoft.SharePoint.SPListItem

The SPListItem object whose field is to be updated.

terms
Type: System.Collections.Generic.ICollection<Term>

The collection of Term objects whose properties are to be used to update the field value.

ExceptionCondition
ArgumentException

One or more arguments to this method are a null reference (Nothing in Visual Basic), or the TaxonomyField object does not allow multiple values.

Each Term has a maximum of one default label for every language in the TermStore object. For each Term, the default Label in the default language of the TermStore is used.

The field will be assigned a TaxonomyFieldValueCollection object.

Show:
© 2014 Microsoft