You need to sign in to do that
Don't have an account?
Pseudodarwinist
Suggest a soql query to find duplicates in Account objects .
Suggest a soql query to find duplicates in Account objects . R1_ACC_TXT_Id_Golden_record__c is a primay key on our Account object.I am using below query to find all instnaces of an Account in our org but the query is timing out.
SELECT count(Id) FROM Account GROUP BY R1_ACC_TXT_Id_Golden_record__c HAVING count(Id)>1
SELECT count(Id) FROM Account GROUP BY R1_ACC_TXT_Id_Golden_record__c HAVING count(Id)>1
Try this code:
Please let me know if that helps you. Thanks.
I had tried executing that from developer console but it always showed "unpacking result" and never completed.Just to update we have more than 10 million Accounts in our Org. Also I want to group them by R1_ACC_TXT_Id_Golden_record__c field so that i can delete all the duplicates.
Regards,
Chetan
Write a bacth job that mark any records as a dulicate based on the match
Or Use salesforce deduplciate APEX
Try this below code. I created this to delete duplicate records.
Change it according to your needs once.
Thanks.
Can you please elaborate a alittle on your suggestions. Do you have in mind any specific third party dedups app? or What is salesforce deduplciate APEX ?
I am a newbie to Salesforce trying to put my toes into its waters before i dive. It would be highly helpful if you please explain it a bit and try to suggext on my Account object.ETL job inserts new Accounts in Salesforce in Bulk and more often than not they end up inserting duplicates.
Let me try my best to explain with comments on each line of code.
I tried to create it according to your needs but may vary slightly as conditions varies.
It's kind of messy, but i used it in many projects to delete dupplicate records and it proved successfull for me. As i'm also being a newbie in salesforce, i love to experiment more in coding :-)
Hope this method of mine helps you too :-)
Thanks.
I will try to implement it for my org But is it going to work on already existing Duplicates which is more than 7 Lacs right now or I will need to write a trigger for this which will kick off for future insertion of Accounts.
Yes it works for existing duplicates record. Try for 1st few 100 records, but before that please do take backup of the records so that if anything happens your records will b safe.
Thanks.
Can someone suggest me to find duplicate reocrds in custom object (which have more than 15 million reocods). I tried by using below query but it consumes more time and failing with CPU time limit exception.
List<AggregateResult> acc=[SELECT Name, count(Id) FROM Account GROUP BY Name HAVING count(Id)>1];
Now i am planning to create batch job find and update those records, but it has to be done by subset of records I guess.
Can someone advise me "Is there any other way to achieve this?"
Thanks in advance !!!