Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

sharepoint 2013 SPDuplicateValuesFoundException generating ID

$
0
0

We have a simple list with one custom column with enforce unique column set to true.

Now when sharepoint 2013 SPDuplicateValuesFoundException occurs with this column sharepoint still creates internal ID column and when new list item is created it creates random ID. For example if current ID is 15 in list and SPDuplicateValuesFoundException occurs 10 times and when new item is created the ID becomes 26. This defeats the purpose of ID column being auot incremental when enforce unique column is set for any other column. We are using this ID(internal column) column concatinated with Proposal-ID-docno and we also have a requirement of unique custom column with enforce unique column but when SPDuplicateValuesFoundException is generated for this column sharepoint is still incrementing ID column on listitem.Update.

This is really weird.

To reproduce the scenario- create simple testid number column and make it enforce unique column set to true and then via code try to create list items with testid column value as duplicate for few items which will raise SPDuplicateValuesFoundException for few items which are duplicate and then observe the ID. It will be random(not 1,2,3,4- but based on count of SPDuplicateValuesFoundException )


MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead





Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>