Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

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)
[ClientCallableAttribute]
[ClientCallableConstraintAttribute(FixedId = "1", Type = ClientCallableConstraintType.Custom, Value = "The value can not be set to FALSE for the built-in fields or for the site columns")]
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.
ExceptionCondition
SPException

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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.