0

I have created a custom list using Visual Studio. Now I have a requirement to set unique value to a column. I tried to set EnforceUniqueValue Property to true in Schema.xml, but it is throwing an error while deploying:

ExceptionMessage: This field must be indexed to enforce unique values. Source: AppWeb SourceName: App Web Deployment

3
  • What error does it throw? Commented Sep 28, 2015 at 14:26
  • ExceptionMessage: This field must be indexed to enforce unique values. Source: AppWeb SourceName: App Web Deployment
    – Sri
    Commented Sep 28, 2015 at 14:29
  • 1
    You must also set the Indexed property equal to true Commented Sep 28, 2015 at 14:45

2 Answers 2

0

By the looks of things you need to override the GetValidatedString method to be able to enforce unique values for a field other than the title field method described here

Hope this helps

0

In your schema.xml, you must include the Indexed property and set it to true. The same is required if you do it in event receiver code or through the user interface. Setting this will resolve your deployment error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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