This topic has not yet been rated - Rate this topic

SPField.ValidateAndParseValue method

SharePoint 2013

When overridden in a derived class, validates and parses the input value and returns a valid object that can be the value of the field.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
public virtual Object ValidateAndParseValue(
	SPListItem item,
	string value
)

Parameters

item
Type: Microsoft.SharePoint.SPListItem
An SPListItem containing a field whose new value needs to be validated.
value
Type: System.String
A string with the value to be parsed and returned.

Return value

Type: System.Object
An object that can be assigned to the field as its value.
ExceptionCondition
ArgumentNullException

Item is null.

The default implementation doesn't do any validating, it simply returns the value.

Consider overriding the ParseValue(SPListItem, String) method and calling it as part of your override of this method.

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.