You need to sign in to do that
Don't have an account?
Unique Check for EmailId in Contact Entity
Hi All,
This may sound like a newbie question, I have started working on salesforce recently and a bit stuck up on some implementations.
I am using the REST way to access salesforce - (OAuth2 to authenticate, and REST implementation to query Salesforce).
1. How do I impose a Unique Index constraint on Email in CONTACT entity, basically I dont want to store duplicate email ids in Contact entities. How do we do it?
I have used Validation Rules to apply Mandatory Check on Email Column, but how do we impose a Unique Check.
2. Also, by default LastName in Contact entity is Mandatory. How to remove this mandatory check.
Can anyone help me regarding this?
Regards,
Naveen Kumar B.V
Create a hidden (not displayed on your page layout) Email__c custom field on Contact - mark this field as Unique (check the Unique checkbox in the field creation wizard)
Set up a workflowrule on contact create / edit (as your business logic maybe), which invokes a field update action - which copies the Email from the default Email field to this custom field. The unique constraint check will return an error message if a duplicate email id is entered.
About the mandatory last name, don't reckon you can get rid of that (not via config anyway) - system constraint.
All Answers
Create a hidden (not displayed on your page layout) Email__c custom field on Contact - mark this field as Unique (check the Unique checkbox in the field creation wizard)
Set up a workflowrule on contact create / edit (as your business logic maybe), which invokes a field update action - which copies the Email from the default Email field to this custom field. The unique constraint check will return an error message if a duplicate email id is entered.
About the mandatory last name, don't reckon you can get rid of that (not via config anyway) - system constraint.
Hi Ritesh,
Thanks for the reply :-) , it gave me some direction on moving forward. I will have to learn how to create workflow rules in salesforce now. Do we have any other way of doing it.
And regarding removing LastName mandatory check, I am planning on creating a new custom field (without a mandatory check).
But a little bit worried on performance issues, do we have any restrictions on the number of custom fields we create.
Or can you please suggest any other way of handling such issues.
Thanks once again.
Regards,
Naveen Kumar B.V
It helped me
Thanks!!!
Thanks