You need to sign in to do that
Don't have an account?

Trigger for avoiding Duplicates in Contact ....
Hi All,
My scenario is I want custom Dupecatcher functionality for Contact Object using Trigger.For that condition Account is having two types of Recordtypes.Company and Person .So i created a formula field in Contact for getting that Account Recordtype in contact level.so based on that formula field i created in contact it should check duplicates.Because the email and mobile which they are having in Person will be replicted in Company contacts also but it will not replicate in Person contatc types.Which means email and mobile in Person Contacts will also be in Company contacts but willnot be again in Person Contacts.
Can any one suggest me for writing trigger for this Scenario.
My scenario is I want custom Dupecatcher functionality for Contact Object using Trigger.For that condition Account is having two types of Recordtypes.Company and Person .So i created a formula field in Contact for getting that Account Recordtype in contact level.so based on that formula field i created in contact it should check duplicates.Because the email and mobile which they are having in Person will be replicted in Company contacts also but it will not replicate in Person contatc types.Which means email and mobile in Person Contacts will also be in Company contacts but willnot be again in Person Contacts.
Can any one suggest me for writing trigger for this Scenario.
Instead of writing a complex trigger to check duplicates, you can achieve this functionality by creating an additional unique Text field on Contact, and create a simple trigger to combine the values of record-type, mobile and email in that field. Salesforce would give an error if duplicate values, i.e., duplicate combinations are entered.
Please modify the trigger for your requirement, but hope you get the idea.
Can you create a sample record, and post the values of email, phone, record-type and this new field as well on this forum ?
Ideally, when you create a new record, this new field should have a string value of recordtypeId, Email and Phone.