SPFieldValueException Constructor (SPListItem, SPField)
Initializes a new instance of the SPFieldValueException class with the specified list item and field.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Sub New ( _
item As SPListItem, _
field As SPField _
)
'Usage
Dim item As SPListItem
Dim field As SPField
Dim instance As New SPFieldValueException(item, field)
public SPFieldValueException(
SPListItem item,
SPField field
)
Parameters
item
Type: Microsoft.SharePoint.SPListItemThe list item in which the exception occurred.
field
Type: Microsoft.SharePoint.SPFieldThe field in which the exception occurred.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | item or field is null . |
Remarks
This exception is thrown when you attempt to set the value of a field in a list item to an invalid value, such setting your age to “abc” rather than using a numeric value. The code creates a new SPFieldValueException with item and field.