DAY18 Apex Trigger to Prevent Duplicate Records in

Поделиться
HTML-код
  • Опубликовано: 2 ноя 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
    RUclips - www.youtube.com/@pantherschools
    LinkedIn - www.linkedin.com/in/cloudyamit/
    Topmate - topmate.io/cloudyamit
    Instagram - instagram.com/cloudyamit/
    Subscribe to our RUclips 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!

  • @asmrrrrrrrrrrrrrrelaxsingg5140

    Nice work AMit bro

  • @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

  • @DebamGarai-zc4lh
    @DebamGarai-zc4lh 7 месяцев назад

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

    • @pantherschools
      @pantherschools  7 месяцев назад

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

  • @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.

  • @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

  • @devarghch
    @devarghch 3 месяца назад

    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  3 месяца назад

      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 3 месяца назад

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

  • @rucha520
    @rucha520 Год назад

    How to handle first trigger in bulk scenario ?

    • @pantherschools
      @pantherschools  Год назад

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

    • @rucha520
      @rucha520 Год назад

      ​​@@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  Год назад

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

  • @Harpreeth29
    @Harpreeth29 3 месяца назад

    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  3 месяца назад

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

    • @Harpreeth29
      @Harpreeth29 3 месяца назад

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

  • @nikhiltripathi2760
    @nikhiltripathi2760 11 месяцев назад +1

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