function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alli IAlli I 

Lead Validation Formulas: new to it all...

Hi, 

 

New to formula's and I need to create 2 validation rules... 

 

1.) That will not allow duplicate leads to be registered

2.) If Company & Email & Last Name are null do not register as a lead.

 

Any advice? 

larrmill59larrmill59

Blocking duplicates is not something you can do with a validation rule because a VR only checks the fields of a record being created or edited and doesn't compare it to other existing records. There are Apex triggers out there that handle de-duping that you can customize to fit, as well as AppExchange utilities you can download.

 

Your second item is easier to manage. Just substitute your field names, then if any of them are blank the error will be displayed. To see this and other examples, click new validation rule on any object, then click on "more examples".

 

OR( ISBLANK( MailingStreet ), ISBLANK( MailingCity ), ISBLANK( MailingCountry ) )
sourav046sourav046
There is a simple but tricky way to block duplicate entries on Leads . Create a custom TEXT field on Lead object e.g Dupeblocker__c . During 2nd step of creation check the option 'UNIQUE' .This will not allow any duplicate values for that field . Remember do not check the REQUIRED check box . Now create a WF rule on Lead Name : whatever you wish . Evaluation Criteria : created, and every time it’s edited [under rule criteria from picklist select FORMULA EVALUATES TO TRUE] Rule criteria : ISNEW( ) Then add workflow action :select FIELD UPDATE . Field to update :Dupeblocker__c There you will see a formula editor .Put there Lead Name . So what exactly you are doing is updating a UNIQUE field by Lead Name. So for duplicate entries for LeadName it is also a duplicate for Dupeblocker__c field which will not allow any any duplicate values . So ultimately you prevented the duplicate on Lead Entries If you want to filter using more fields,concat all together and then field update to Dupeblocker__c field