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)

Syntax

'Declaration
Public Sub SetFieldValue ( _
    item As SPListItem, _
    terms As ICollection(Of Term) _
)
'Usage
Dim instance As TaxonomyField
Dim item As SPListItem
Dim terms As ICollection(Of Term)

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

Parameters

Exceptions

Exception Condition
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.

Remarks

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.

See also

Reference

TaxonomyField class

TaxonomyField members

SetFieldValue overload

Microsoft.SharePoint.Taxonomy namespace

GetFieldValue(String)

AllowMultipleValues

TaxonomyFieldValue

Term

Microsoft.SharePoint.Taxonomy

Microsoft.SharePoint