5

I'm experiencing an issue that in my programatically created SharePoint List, if I add two items with the same "Title" field, it tells me the following error:

Sorry, something went wrong A configuration entry already exists with this key. Please choose a different key.

This does not meet our requirements, since the Title field is displayed on a content query web part, in various countries, and may share the same name.

Is there anything that can be added to the ListInstance on creation, or configured post list creation, to allow these items in multiples?

I checked the Schema.xml associated with the list and found no direct unique/index columns specified. Also, we removed all links to indexed columns via the List Settings. We are using SharePoint 2013.

Thanks.

  • If you look at the list settings in the UI and click on the Title field, is it set to allow unique values? – Eric Alexander Oct 3 '13 at 16:08
  • Title is currently configured to "Require that this column contains information" to Yes, and "Enforce unique values" to No. – Quinn Johns Oct 3 '13 at 17:03
  • 2
    This does not look like a SharePoint error. Can you confirm that there are no custom event receivers doing some sort of validation. – sssreddy Oct 7 '13 at 18:19
  • Confirmed. Also, we've created net new lists using the UI, and this dubious behavior occurs there as well. – Quinn Johns Oct 9 '13 at 13:22
2
+25

As @sssreddy mentioned, this does not look like a SharePoint issue and is most probably related to your environment. I have tried to reproduce your issue on my SP2013 box but could not.

Can you try your solution on a new SharePoint 2013 Farm? If it works there, that means something is wrong with your current SP installation.

  • As probable as this could be, is there a relative solution to this problem. I understand that the title fields are generally the initial and default lists used, but would it be worthwhile to just replace the list column with just a new column, not called title? – Quinn Johns Oct 7 '13 at 21:09
  • Also, in short, we aren't using any event/feature receivers in conjunction with this list. – Quinn Johns Oct 7 '13 at 21:10
2

Even if the Schema doesn't have the "Enforce Unique Values" or "Indexing", I would make sure that the actually deployed list doesn't have those on. If that's the case, try turning it off.

To understand your scenario: you created a List Definition using a Schema.xml file, and then programmatically created the List Instance?

  • Well, we did the standard scenario, of creating a list instance as part of the solution; schema, etc. This list is created as part of the site-scoped feature activation. In terms of Indexing and Enforce Unique Values, they are set to "FALSE". I'm beginning to be more inclined that @sssready is right, and that we may have an issue with our environment. – Quinn Johns Oct 9 '13 at 13:20
  • We also explicitly forced the values themselves to not have properties, and confirmed via using SharePoint Manager 2013. – Quinn Johns Oct 9 '13 at 13:21
  • Yeah, in case @sssready is right, did you try activating the feature in a different Web Application and Site Collection? To verify if it is specific to this Web App/Site Collection. – Amadeo Gallardo Oct 9 '13 at 16:11
1

What content type are you inheriting from? Custom list or document library? Perhaps the title field in the content type you are inheriting from has some limitations.

  • It's the base "custom list" content type. – Quinn Johns Oct 10 '13 at 13:59
0

It seems that the list is used to storage some Configuration Entries. So, there must be some thing to ensure the KEY unique. who create the list definition ? you, or the third party? Try to modify the Type attribute of the List element to a new unique integer value, and do a iisreset. create a new list then test again. (i guess there's a event handler register to the List Type )

0

I also think that somehow an event receiver has been attached to your list. Could you please use SharePoint Manager and verify that really no event receivers are attached to your list. http://spm.codeplex.com/

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.