TaxonomyField.SetFieldValue Method (SPListItem, TaxonomyFieldValueCollection)
Sets the value of the corresponding multi-valued field in the list item to the value of the specified TaxonomyFieldValueCollection object.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Sub SetFieldValue ( _
item As SPListItem, _
taxValueCollection As TaxonomyFieldValueCollection _
)
'Usage
Dim instance As TaxonomyField
Dim item As SPListItem
Dim taxValueCollection As TaxonomyFieldValueCollection
instance.SetFieldValue(item, taxValueCollection)
public void SetFieldValue(
SPListItem item,
TaxonomyFieldValueCollection taxValueCollection
)
Parameters
item
Type: Microsoft.SharePoint.SPListItemThe SPListItem object whose field is to be updated.
taxValueCollection
Type: Microsoft.SharePoint.Taxonomy.TaxonomyFieldValueCollectionThe TaxonomyFieldValueCollection object whose valueis to be used to update this field.
Exceptions
Exception | Condition |
---|---|
ArgumentException | One or more of the arguments to this method are a null reference (Nothing in Visual Basic). |
NotSupportedException | The field is not multi-valued. |