How to develop Apex Trigger to Prevent Duplicate Contact?

on

|

views

and

comments

Hi Everyone,

In this post, we will discuss how to work with apex trigger and logic building.

Below is the Agenda for the post

1 – Problem Statement
2 – Possible Solution
3 – Choosing the right solution
4 – Solution Approach
5 – Develop the Apex Trigger
6 – Assignment – Develop a Trigger to Prevent duplicate Lead Record based on FirstName, LastName, & Email

Link to Video

Link to PPT

 

Happy Learning 🙂 Sharing is Caring 🙂

#HappyLearning #Salesforce #JourneyToSalesforce

Amit Singh
Amit Singhhttps://www.pantherschools.com/
Amit Singh aka @sfdcpanther/pantherschools, a Salesforce Technical Architect, Consultant with over 8+ years of experience in Salesforce technology. 21x Certified. Blogger, Speaker, and Instructor. DevSecOps Champion
Share this

Leave a review

Excellent

SUBSCRIBE-US

Book a 1:1 Call

Must-read

How to Utilize Salesforce CLI sf (v2)

The Salesforce CLI is not just a tool; it’s the cornerstone of development on the Salesforce Platform. It’s your go-to for building, testing, deploying, and more. As one of the most important development tools in our ecosystem

Save the day of a Developer with Apex Log Analyzer

Table of Contents What is Apex Log Analyzer? Apex Log Analyzer, a tool designed with Salesforce developers in mind, is here to simplify and accelerate your...

Salesforce PodCast

Introduction Hey Everyone, Welcome to my podcast, the first-ever podcast in India for Salesforce professionals. Achievement We are happy to announce that we have been selected as Top...

Recent articles

More like this

6 COMMENTS

  1. Hi Author,

    I wrote a trigger to avoid duplicate contacts, but the problem with it is that it throws an error when I try to update(any other random field) an existing contact record because it compares the email with the same record’s old version and throws an error. I thought your code might solve the issue but it is the same in your case too.
    The above trigger is not suitable for ‘before update’ , I am working on the solution for the same, will post soon.

    Regards,
    Amarnath

  2. Hi Amit,
    how can we create/update other Object records when we have used either addError or any validation rule becoz that will roll back everything even by using async also that will not work.
    Is there any way by which we can raise error on contact and create a task or something like this.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

5/5

Stuck in coding limbo?

Our courses unlock your tech potential