Notifications
Announcements
No record found.
Hi,
Currently I am getting duplicate record error when I try to create another record with the same name. In my table, name is used as primary key. I cannot change the primary key from name to something else because there are already lots of other tables depending on this table. I also read in the forum that name field even if it's a primary key can be duplicated so not sure why I am getting the error. Can some please help me to resolve this issue?
Can you check if you have Alternate key defined for Name field?
Also check if duplicate detention rule exist for you entity
Your error message is due to an alternate key on the primary name of your entity.I explain below how to list the Alternate Keys.
If needed, you can remove the alternate key.
I also explain how to see the Duplicate Detection Rules below.
Is it a custom entity ?
Alternate key
Navigate to Advanced settings => Settings => Customization => Customize System => Your entity => Alternate key.
Duplicate Detection Rules
You can customize the Duplicate Detection Rule in Advanced Settings => Settings => Data Management => Duplicate Detecton Rules.
The primary key is GUID in CRM. You can check if there is any alternative key/Duplicate detection rule or any custom code is working on name
Hey Bipin,
I don't see any Alternate keys and also there is no duplicate detection rule for this entity.
Hey Xavier,
Can you deactivate Alternate key on prefix_Name field which is visible on your screenshot and then try to create record with same name?
That's the primary key, not the alternate key.
Alternate Key = Keys in a solution, so you have an Alternate Key.
The error you have comes from the presence of the Name line in Keys.
If you don't want this Alternate Key, you could disable/remove the Name line.
Remove this Alternate Key implies that the Name field will no longer be unique and that you could not access to a record of this entity with its Alternate Key in WebAPI.Do you know why this field was set as an Alternate Key ?
Hi, thanks for your response. The key was added to primarily avoid the duplication of the same name.
But my requirement is that if the same name is an inactive record then I must be able to create another record with another name. Deleting the key will fix one issue which is yes I can create another record with the same name. However, I also don't want duplicate ACTIVE records.
Ok, the actual Alternate Key can't meet your needs.
To meet your needs, you can either:
1 .Create a Duplicate Detection Rule on Name field for Active records.2. Create Plugin that throw an exception when the record is active and a duplicate is found.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 170 Super User 2025 Season 2
#ManoVerse 61
Gerardo RenterÃa Ga... 52 Most Valuable Professional