Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

When defining a site column in XML, what is the difference between AllowDuplicateValues and EnforceUniqueValues?

AllowDuplicateValues="False"
EnforceUniqueValues="True"

Logically it should do the same, if I'm thinking right?

Some intrestring links

msdn documentation - Field Element (Field)

msdn documentation - SPField.EnforceUniqueValues Property

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

According to the Docs, the best answer to me is that the AllowDuplicateValues attribute is used when defining the field in XML code while the other is used when writing .Net code.

share|improve this answer
    
I also agree with Spevilgenius. –  Sepaka Nov 1 '11 at 10:35
add comment

Daniel is right in so far as the docs say to use AllowDuplicateValues in CAML schema and EnforceUniqueValues in code.

The documentation is wrong, though; to make the CAML work you need to use the EnforceUniqueValues attribute.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.