SharePoint Server 2013: A Duplicate Field Name "XXX" Was Found

Introduction

When developing Site Columns, Content types and so on programmatically in SharePoint we need to follow some rules. The basic rule of thumb for creating a Site Column is you should not use any reserved or system name for the field. You might have come across an issue like "Duplicate Filed name was found" when upgrading the solution from SharePoint 2010 to SharePoint 2013. Here I will provide a brief overview of what went wrong in your 2010 solution and how to fix the issue.

Solution

When upgrading a solution from SharePoint 2010 to SharePoint 2013 when we deploy our SharePoint Solution you might receive an error such as this in Visual Studio. We might think we haven't successfully upgraded the solution but there is nothing wrong in your solution settings. It is an internal name that you have used for the SharePoint Column that has been reserved in the SharePoint System.Try and search the field name in your solution that you have received in an error for.

                                          error

For example consider you have received an error like A duplicate field name "Status" was found. Here the field name Status is a reserved name in SharePoint. You need to replace this name with something related to your solution like "MyStatus". Just change this and now try and deploy the solution, it should be deployed successfully.

  1. <Field    
  2.      ID="{a428ab22-64d1-4c42-9845-b50bac3d6545}"    
  3.      Name="Status"    
  4.      DisplayName="Staus Field"    
  5.      Type="Note"    
  6.      Required="TRUE"    
  7.      Group="MyCustomColumn">    
  8. </Field>    
Here we need to replace the name value to MyStatus as shown below.
  1. <Field    
  2.        ID="{a428ab22-64d1-4c42-9845-b50bac3d6545}"    
  3.        Name="MyStatus"    
  4.        DisplayName="Staus Field"    
  5.        Type="Note"    
  6.        Required="TRUE"    
  7.        Group="MyCustomColumn">    
  8. </Field>    

Now you should be good to go. Happy SharePointing!

 

Up Next
    Ebook Download
    View all
    Learn
    View all