SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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
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

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

Your Answer


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.