TaxonomyField.SetFieldValue Method (SPListItem, Term)
Sets the value of the corresponding field in the list item to the properties of the specified Term object in the default language of the TermStore object.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Sub SetFieldValue ( _
item As SPListItem, _
term As Term _
)
'Usage
Dim instance As TaxonomyField
Dim item As SPListItem
Dim term As Term
instance.SetFieldValue(item, term)
public void SetFieldValue(
SPListItem item,
Term term
)
Parameters
item
Type: Microsoft.SharePoint.SPListItemThe SPListItem object whose field is to be updated.
term
Type: Microsoft.SharePoint.Taxonomy.TermThe Term object whose properties are used to update the field value.
Exceptions
Exception | Condition |
---|---|
ArgumentException | One or more arguments of this method are a null reference (Nothing in Visual Basic). |
Remarks
A Term has a maximum of one default Label for every language in the TermStore object. The default Label used by this method is the default Label of the Term in the default language of the TermStore object.