You need to sign in to do that
Don't have an account?
Michael M
How to write SOQL query to find duplicate person accounts
Hello, I need to find all of our duplicate person accounts. Specifically, I want to find all Person Accounts where EITHER:
1) Name AND Date of Birth (custom field) match, OR
2) Custom ID Number (custom field) matches.
How would I write both of those SOQL queries?
1) Name AND Date of Birth (custom field) match, OR
2) Custom ID Number (custom field) matches.
How would I write both of those SOQL queries?
I haven't tried this myself so I am unsure if it will work but here is a post explaining how the results will be returned when we want to group two fields
All Answers
The query usually looks like this, replace the exact API name of the field that you want to match with along side of GROUP BY
Let me know if it helps
Anudeep
I need to check for all Person Accounts that have 2 of the same field: matching name AND matching DOB.. How would I write that?
I haven't tried this myself so I am unsure if it will work but here is a post explaining how the results will be returned when we want to group two fields
The best way to do is to use Database.merge. I recommend reviewing the example from the documentation
If you find any of the information I shared helpful, please mark this answer as Best. Thank You!
Anudeep