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

  • What error does it throw? – Robert Lindgren Sep 28 '15 at 14:26
  • ExceptionMessage: This field must be indexed to enforce unique values. Source: AppWeb SourceName: App Web Deployment – Sri Sep 28 '15 at 14:29
  • 1
    You must also set the Indexed property equal to true – Eric Alexander Sep 28 '15 at 14:45
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, privacy policy and cookie policy

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