DAY18 Apex Trigger to Prevent Duplicate Records in

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024

ความคิดเห็น • 34

  • @pantherschools
    @pantherschools  ปีที่แล้ว

    *_Link to document -_* www.pantherschools.com/how-to-prevent-duplicate-record-using-trigger/
    Follow us on Social Media Channels -
    Telegram Channel - telegram.dog/sfdcpanther
    TH-cam - www.youtube.com/@pantherschools
    LinkedIn - www.linkedin.com/in/cloudyamit/
    Topmate - topmate.io/cloudyamit
    Instagram - instagram.com/cloudyamit/
    Subscribe to our TH-cam channel using the below link
    bit.ly/pantherschools
    Join our telegram channel
    bit.ly/sfdcpanther

  • @SachinM1985
    @SachinM1985 ปีที่แล้ว +4

    Thank you Sir. Even paid courses are not provided this type of knowledge🙏

  • @abhimanyusingh9093
    @abhimanyusingh9093 ปีที่แล้ว +2

    great initiative sir Hindi me padhane k liye

  • @Suryanarayan094
    @Suryanarayan094 ปีที่แล้ว +1

    Thank you Amit Bhai for beautiful explanation.

  • @hemakumar4457
    @hemakumar4457 ปีที่แล้ว +1

    Great content, very informative!

  • @DebamGarai-zc4lh
    @DebamGarai-zc4lh 6 หลายเดือนก่อน

    Please make a video on the scenario of duplicate records in the new records while bulk load

    • @pantherschools
      @pantherschools  6 หลายเดือนก่อน

      We have already covered the same in the coming videos. Keep watching

  • @asmrrrrrrrrrrrrrrelaxsingg5140
    @asmrrrrrrrrrrrrrrelaxsingg5140 ปีที่แล้ว

    Nice work AMit bro

  • @devarghch
    @devarghch 2 หลายเดือนก่อน

    Bhaiya, 28:31 pe joh bhi aapko name aur rating mile the, uspe query karke agar account list ka size >0 hojata toh pata chal jata duplicate hai ya nahi
    lekin aap last me dubara 2 for loop kyu use kiye?

    • @pantherschools
      @pantherschools  2 หลายเดือนก่อน

      inner loop will make sure ki hm add error sahi record pe kr rahe hai jiska duplicate hai na ki kisi bhi record me

    • @devarghch
      @devarghch 2 หลายเดือนก่อน

      @@pantherschools Got it Bhaiya! Aapka class sunke bahut maza aata hai aur seekhne ko bhi milta hai :D

  • @rohittanwesh7608
    @rohittanwesh7608 ปีที่แล้ว

    Thank you amit Bhai..but i have a doubt apex best practice says avoid SOQL inside for loop so why you use inside

    • @pantherschools
      @pantherschools  ปีที่แล้ว

      Hello 👋,
      You should have watched the complete video because I have made the query on purpose and then removedb

  • @sagarr7940
    @sagarr7940 ปีที่แล้ว

    Have a quick question on the soql query I’m not sure how we are adding a filter with list of new records. As these records are not yet committed to sf so how can we get the id from those records ? Can you give some insight on this please @pantherschool time stamp 19:28 min

    • @pantherschools
      @pantherschools  ปีที่แล้ว

      The scenario we are talking about here in this timestamp is for update and in case of before update we will have the records id

  • @sagarr7940
    @sagarr7940 ปีที่แล้ว

    @PantherSchool how can we know that we need to type cast the values when we are passing Trigger.oldMap? also in the dispatcher System.TriggerOperation?

    • @pantherschools
      @pantherschools  ปีที่แล้ว

      Everytime you want to pass the Map from the Dispatcher class to the Handler class and those maps are part of the Trigger Context variable.

  • @Harpreeth29
    @Harpreeth29 2 หลายเดือนก่อน

    Sir location record is created but under location record account field is blank
    please tell me where I made mistake and if I use whatId then code is not running.
    public static void createLocationUnderAccount(List accountList) {

    List locationList = new List();

    for(Account acc : accountList) {
    // prepare a location record

    for (Integer i = 0 ; i < acc.NumberofLocations__c ; i++ ) {
    Location__c loc = new Location__c();
    loc.Name = 'created from account Trigger ' + acc.Name;
    loc.Account__c = acc.Id;
    loc.OwnerId = acc.OwnerId;
    locationList.add(loc);
    }


    }

    insert locationList;
    }

    • @pantherschools
      @pantherschools  2 หลายเดือนก่อน

      check the event of your apex trigger. it should be after insert

    • @Harpreeth29
      @Harpreeth29 2 หลายเดือนก่อน

      @@pantherschools Thanks sir now problem is solved and your playlist is very useful for understanding salesforce development.🙏🙏

  • @rucha520
    @rucha520 11 หลายเดือนก่อน

    How to handle first trigger in bulk scenario ?

    • @pantherschools
      @pantherschools  11 หลายเดือนก่อน

      I didn't get which triggere you are talking about. But we have talked about how to make them bulkified

    • @rucha520
      @rucha520 11 หลายเดือนก่อน

      ​​@@pantherschools in the first trigger prevent duplicate contact if we insert using collections then duplicates will be skipped.
      36:18
      At 43:34 you said u will explain later. Can u please tell where to find bulk handling

    • @pantherschools
      @pantherschools  11 หลายเดือนก่อน

      @@rucha520 We have covered in the coming lectures. Please keep watching those.

  • @nikhiltripathi2760
    @nikhiltripathi2760 10 หลายเดือนก่อน +1

    List accList = [SELECT Id,Name,Rating FROM Account WHERE NAME =:acc.Name AND Rating=:acc.Rating AND ID !=:acc.Id];