validation rule to prevent duplicate account name - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Salesforce GeevanSalesforce Geevan 

validation rule to prevent duplicate account name

Julien SALENSONJulien SALENSON
Hi Geevan,

I have better than validation rule for that :
Intall apexchange Dupecatcher, it's free : DupeCatcher enables you to identify, block and dedupe accounts (and also leads, contact..) in real-time at the point-of-entry.
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003IYLlEAO

Regards,
Pritam ShekhawatPritam Shekhawat
In General way, you can't do this. You can Promote and upvote this idea here Stop the ability of creating (https://success.salesforce.com/ideaview?id=087300000007giUAAQ) duplicate Accounts

But using the custom field and workflow rule you can do this. @Steve explains this under this idea.
Create a custom field on the Account Object 
Datatype: Text (Don't add on page layout)
Field Name: Duplicate Name 
In the General Options select: "Do not allow duplicate values"
 
Then create a Workflow Rule with a Field Update
 Field Update
Object: Account
Field to Update: Account: Duplicate Name 
Formula Value: Name

SO it will not allow the user to save the duplicate value in Account Name.
Avinash VatsyaAvinash Vatsya

You can not run validation rule on other records to check their name or any other field.

But If you want to put a validation on Account Name then you can create a trigger. 

Munazza AhmedMunazza Ahmed
I had a similar requirement and I achieved it by trigger. The other way is to get this app called Dupe Catcher. It is also very helpful.
Ranu BariRanu Bari
++Pritam,
Duplicate field and WFR solution is good :) but for existing records you will have need to update 'Duplicate Name' field value with Name field of Account. Otherwise WFR will not consider old data to find out duplicates, because their 'Duplicate Name' field is blank.
You can set "Do not allow duplicate values" at the field creation time :
User-added image
TM SFDC AdminTM SFDC Admin
I don't understand the purpose of this thread or DupeCatcher tool - Salesforce Lightning has all this functionality natively, including pro-active alerting for potential duplicate Accounts and Contacts (in Classic, it just sucks because you can't tell until you hit Edit and save). Is this just for people not on Lightning?