You need to sign in to do that
Don't have an account?
Mike Dwyer 9
How can I resolve a duplicate Name value in a custom object?
This may be buried somewhere in the forum, but I cannot tease out the answer to my situation. I apologize for any - uh - duplication.
We have a custom sObject in our org. Records created in 2015 have been found to have a duplicate Name value. That is, two distinct records, with different Id values on each, both have the same Name value. Name, for what it's worth, is an AutoNumber field.
I can query both records into the Developer Console query results, but I cannot change the Name value. How can I make the Name as unique as the Id?
Second question: How can I find other similar duplicates? In SQL, I would use SELECT Name, Count(Id) FROM LOIS_Offender__c GROUP BY Name ORDER BY Count(Id) DESC, but SOQL says, "field 'Name' can not be grouped in a query call".
We have a custom sObject in our org. Records created in 2015 have been found to have a duplicate Name value. That is, two distinct records, with different Id values on each, both have the same Name value. Name, for what it's worth, is an AutoNumber field.
I can query both records into the Developer Console query results, but I cannot change the Name value. How can I make the Name as unique as the Id?
Second question: How can I find other similar duplicates? In SQL, I would use SELECT Name, Count(Id) FROM LOIS_Offender__c GROUP BY Name ORDER BY Count(Id) DESC, but SOQL says, "field 'Name' can not be grouped in a query call".
I suggest using an ordinary query, order by name and then process the results, perhaps using batch apex.
(Run these in developer console, after changing field Api names & object api name)
------------------------------------------------------------------------------------
You'll have to run report to see duplicate values (given that you have admin proviledges, access to all records in the object)
Create report on your custom Object
Created Date Range -> All time, Show -> All Records
Just keep relevant fields in the table
Click on Name field, Select Group By this field
Run report.
I did it for checking duplicate websites in Account
All the records with hyperlink will be listed in the table below (grouped by Website).
Apparently, I have 517 records with Website = NULL & 3 records with website www.uos.com
If this helps solve your problem, please mark this as BEST ANSWER
Neither answer is a reasonable method for solving the second question. It is irritating that with all the supposed power of "no code" Salesforce, that a simple SQL query cannot be performed without external processing.