Це відео не доступне.
Перепрошуємо.

Duplicate Contact Trigger || Trigger Logic Building ||

Поділитися
Вставка
  • Опубліковано 16 жов 2019
  • Want to learn more about salesforce join me at sfdcpanther.com Hi Everyone,
    In this video, we will discuss how to work with apex trigger and logic building.
    Below is the Agenda for the video
    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 ApexTrigger:- gist.github.co...
    Link to PPT:- www.slideshare...
    Contact Me -
    LinkedIn
    / simplyamit
    FaceBook
    / sfdcpanther
    Twitter
    / cloudyamit
    Instagram
    t.me/sfdcpanther
    Blog
    sfdcpanther.com
    Email
    sfdcpanther@gmail.com
    Previous Video
    OAuth 2.0 • An Overview to OAuth 2...
    #SalesforceForBeginner #Salesforce #ApexTrigger
    #JourneyToSalesforce

КОМЕНТАРІ • 30

  • @D_Salesforce
    @D_Salesforce 7 місяців тому +1

    I have gone through many videos and sites but This is best solution to avoid duplicate records .

  • @mchan9424
    @mchan9424 9 місяців тому

    This is the best solution i have seen so far for duplicate trigger scenario!

  • @akashubhambhardwaj
    @akashubhambhardwaj 4 роки тому +2

    NICE ONE Amit Bhai

  • @SalesforceMiind
    @SalesforceMiind 7 місяців тому

    Hi Amit, the above code is not working for before update scenario. please try to update any field of the existing contact. then it hits duplicate email found. The email of the contact record is getting assigned to both "newEmailSet" and "existingEmailSet".

  • @vishwaskumarjyothula9286
    @vishwaskumarjyothula9286 3 роки тому

    Very good explanation amit

  • @jlayinronchi5888
    @jlayinronchi5888 4 роки тому +1

    Awesome😋

  • @abnn4053
    @abnn4053 3 роки тому

    Good explanation 🤗

  • @JAYESHSHEWALE
    @JAYESHSHEWALE 4 роки тому +1

    Hi Amit,
    Thanks for sharing your knowledge.
    I wanted some help from your side regarding interview.
    Please tell me scenarios for trigger so that I can do the practice.
    Also please tell me how can I do the preparation for my interview.

  • @shivanandtotar4357
    @shivanandtotar4357 4 роки тому

    good explanation

  • @abhijeetgajbhiye
    @abhijeetgajbhiye Рік тому

    Thank you

  • @messilionel2000
    @messilionel2000 2 роки тому

    Can we use this trigger in lightning component

  • @rezanfunchica5839
    @rezanfunchica5839 3 роки тому +2

    I need give five possible triggers on this scenario

  • @priteshtiwari893
    @priteshtiwari893 4 роки тому +1

    I need your all videos on the salesforce from beggining so please provide me links

    • @sfdcpanther
      @sfdcpanther  4 роки тому

      Here is the link for you
      ua-cam.com/users/SFDCPanther

  • @shekarsangishetti5066
    @shekarsangishetti5066 2 роки тому

    trigger is not working for bulk records, when i tried to insert 10 records in that 1 record is duplicate, it should insert remaining 9 records but it is not happening can you help me on ths

    • @sfdcpanther
      @sfdcpanther  2 роки тому

      Trigger never insert the partial data. It will either fail or pass not other outcomes are there.
      If you want to insert the remaining records then first you have to insert all the records and then delete the duplicate records which is not recommended.

  • @rucha520
    @rucha520 Рік тому

    If you try to update any field on same record again it will throw error

  • @AmritMega
    @AmritMega 2 роки тому

    Hi Amit,
    While inserting duplicate records from Anonymous, on line no. 42, we are adding the first contact record email to the set and not calling addError on that record, but for second record, line no. 40 gets executed and we call addError method because we added that email while iterating the first record.
    Then, if we are not calling addError for the first record, then at least the first record should be inserted right, because for the second we called addError, and not the first.
    Please help me over this doubt.

    • @rucha520
      @rucha520 Рік тому

      This may be due to bulkification befaire we are using List to insert records at once. So eaither all will be inserted or none. Since 1 record fails whole list is stopped from inserting.

  • @ironntech
    @ironntech 4 роки тому

    But how to update other fields of record it fires duplicate error

    • @sfdcpanther
      @sfdcpanther  4 роки тому

      Yeah. It will show duplicate error. There are 2 options that we can go to resolve the error.
      1 - In the trigger check if email field is changed then only execute the rest piece of code.
      2 - Do the data clean-up for that object that will resolve the issue as you will not be having the duplicate records for the object.

    • @proudindian6214
      @proudindian6214 2 роки тому

      @@sfdcpanther sir please tell the code to do that

  • @sreenadhgudi3782
    @sreenadhgudi3782 2 роки тому

    Hai Amit Jii,
    I have a doubt, from all new version of records(being to insert, update and undelete)...we are adding email field into set (newEmailSet)...here itself we are filter the duplicate emails then why did we get error when we trying to add contacts with same email. I am not getting your point in your explanation, can you please clarify my doubt.

    • @sfdcpanther
      @sfdcpanther  2 роки тому +3

      Adding the emails in a set does not meant that you can prevent the duplicate records.
      Set contains unique values that means in a set no duplicate values will be added.
      Duplicate record is a complete different things

  • @manalelkahili2787
    @manalelkahili2787 3 роки тому

    why we didnt work with newEmailSet

    • @sfdcpanther
      @sfdcpanther  3 роки тому

      NewEmailSet is only used to get the existing contact emails and once we got the existing email we don't need to use new emails

  • @hupendersharma5255
    @hupendersharma5255 3 роки тому

    sir agar aap list me duplicate record dolte ho to kam se kam 1 record to insert ho .. ye to puri list per error aa gaya
    Please insert record with anonymous window

    • @sfdcpanther
      @sfdcpanther  3 роки тому

      If you have duplicate records in a list and trying to update then you will get the error.
      What error are you getting?