TaxonomyField.ValidateAndParseValue method
Parses the field value and returns a validated object.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Overrides Function ValidateAndParseValue ( _
item As SPListItem, _
value As String _
) As Object
'Usage
Dim instance As TaxonomyField
Dim item As SPListItem
Dim value As String
Dim returnValue As Object
returnValue = instance.ValidateAndParseValue(item, _
value)
public override Object ValidateAndParseValue(
SPListItem item,
string value
)
Parameters
item
Type: Microsoft.SharePoint.SPListItemThe item containing the TaxonomyField for which the value is to be updated.
value
Type: System.StringThe field value in the same format as the PopulateFromLabelGuidPair(String) method (for single-value fields) or the PopulateFromLabelGuidPairs(String) method (for multi-value fields).
Return value
Type: System.Object
A parsed and validated TaxonomyFieldValue or TaxonomyFieldValueCollection object.
Remarks
This method is called by the client-side rendering framework when a field value needs to be updated.
A TaxonomyField is unique because it requires its value to be set using TaxonomyField.SetFieldValue method, instead of the more direct way of setting SPListItem["fieldName"]=value. Since the caller has no knowledge of this requirement, this method automatically calls the TaxonomyField.SetFieldValue method. You need to be aware that this method does more than just validate and parse the field value, but only for TaxonomyField objects.