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

How to find duplication in email field?


i have created a field called "Email" and now i need to add if user gives the same mail id for second time, need to give a error message.

can anyone help me on this with out using triggers?

Arpit Jain7Arpit Jain7
Hi Venkat,

If Email is custom field you can make that field as unique and then it will not allow any duplicates. If it is an statndard field you can create 1 custom field for email with unique checkbox set to true. Create WF rule and copy Email field value to this new field. Now in case of duplicate email system will throw error.

Let me know if this will help you
Ravi Dutt SharmaRavi Dutt Sharma
Hey Venkat, 

You can create duplicate rules on that object. duplicate rules has an option to display a warning based on the attributes configured in it.
More information about duplicate rules can be found here : Duplicate Rules in Salesforce (
HI Arpit,
The field is a custom field and can i know how to make that field as unique?
can you explain me ?
Arpit Jain7Arpit Jain7
Hey Venkat,

On the field you have the option to make it Unique.

User-added image

Let me know if this helps.

Hi Arpit,
i created a field in visual force page, for this how i can do?
Arpit Jain7Arpit Jain7

Hi Venkat,

May be you can try below approach:

Maintain a set of string where you need to maintain the email id's of record which already are entered by user and when user enter same email address and hit the button then you need to check the selected value in email field already present in the set (which we have created to store selected record) or not. If it is present then you can show a message record alread exist.

Hope it helps!