Monday, December 29, 2014

Unexpected error on add from existing site columns in Sharepoint

I recently ran into an issue with trying to ‘Add from existing site columns‘ to one of my SharePoint lists on a specific SharePoint site.
When doing so I was presented with:

——————————————————————
Error
An unexpected error has occurred.
Correlation ID: GUID
—————————————————————–
Looking up that Correlation ID in the SharePoint 2010 ULS logs I saw this error:

“Unexpected System.ArgumentException:  No two choices should have the same ID at Microsoft.SharePoint.ApplicationPages.ChoiceCompareWithDefaultGroup.Compare”

What this initially told me was there were two Site Columns in my Site that was using the same internal name, and that Site column was associated with my list which is preventing me from adding any additional columns.
By browsing to the Site Collection Site Columns (http://portal/site/_layouts/mngfield.aspx) I noticed under one of my Site Column Groups that there were two Site Columns listed with the same InternalName, Type and Source.
After verifying  that this Site Column was not being used in my List I removed one of the Site Columns from that Site Column Group.
Once I removed that Site Column I went back to my list, and was now able to ‘Add from existing site columns‘ without error.

Hopefully this helps others who have encountered the same issue.