Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
EnforceUniqueValues property
Collapse the table of content
Expand the table of content

SPField.EnforceUniqueValues property

Gets or sets a Boolean value that specifies whether to enforce uniqueness in column values. The default is false.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public bool EnforceUniqueValues { get; set; }

Property value

Type: System.Boolean
Returns true to enforce uniqueness in values that populate a specified column; otherwise false. The default is false.


You cannot set this property to true for a built-in field or for a site column.

When you set this property to true, you should also set the Indexed property to true.

The equivalent XML attribute for the Field element in a field definition is AllowDuplicateValues.

© 2015 Microsoft