Apex Triggers - 3 (Update Child by Parent)

แชร์
ฝัง

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

  • @user-ff3pi7nu4n
    @user-ff3pi7nu4n 6 หลายเดือนก่อน +3

    Not pointing out mistakes but you wrote for isAfter : before record gets saved, I was making notes but thought this is not correct so i saw you also have the same thing but you explained it right. but as i was making notes from your ppt i thought it to be wrong please take caution with the PPT.
    Apart from that amazing job I'm going to finish the entire playlist thank you for this playlist.

  • @srisadgurusairam1688
    @srisadgurusairam1688 6 วันที่ผ่านมา

    Nice Explanation

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

    Helpful for us and you are explaining in easy way

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

      thank you so much

  • @joharR-ju7ml
    @joharR-ju7ml 19 วันที่ผ่านมา

    Thank you

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

    Very helpful and you make it very easy to understand

  • @subhisingh4004
    @subhisingh4004 5 หลายเดือนก่อน

    thankyou

  • @sagarikabhelkar3477
    @sagarikabhelkar3477 ปีที่แล้ว +3

    Please see to it I think after triggers it will be fired after the record is saved you said it correctly but there's a printing mistake for isAfter context variable

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

      Great observation!!
      Thanks for noticing there is a printing mistake.

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

    Informative 👍

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

    Very good video

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

    why am I getting error whenever I insert a new record with phone number?

  • @sanketteltumbade
    @sanketteltumbade 6 หลายเดือนก่อน +1

    Hello sir ! In line no.19 can we do f Account .phone through child to parent query and instead of fetching Account ID
    Con.phone = Con.Account.phone;

  • @Kings238
    @Kings238 7 หลายเดือนก่อน

    such a good job really wonderfull sir supperb teaching yahaaaaaaaaaaaaa🥳🥳🥳🥳

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

      Thank you so much 😀

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

    very easy to understand

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

    Thanks sir

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

    Please make a video whenever contact description field is updated update the related account description field

  • @sameerqadri9877
    @sameerqadri9877 5 หลายเดือนก่อน

    is this cover Bulk records update as well ??
    Iam created Apex Handler Class in that i have written Logic and i wnat to call the logib from trigger how can i call ? and the logic is same as yours ??
    Trigger :
    if(trigger.isafter && trigger.isupdate){
    AccountHandler.updatechildrecords(trigger.new, trigger.OldMap);
    }
    Error is showing : what can i do ??
    Method does not exist or incorrect signature: void updatechildrecords(List, List) from the type AccountHandler

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

      Hey buddy its late but did you got the answer

  • @hemantsinghbisht4371
    @hemantsinghbisht4371 9 วันที่ผ่านมา

    Hi can anyone tell me why I'm not getting any changes in account object even tho I have done all the steps just like video .! 😮

    • @sfdcninjas
      @sfdcninjas  9 วันที่ผ่านมา

      Hi can you please share your code

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

    Sir How to write Test Class For this ?

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

      you just need to create test data in your test class according to trigger, don’t worry I will upload test classes for all triggers soon.

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

      @@sfdcninjas have you uploaded the test classes yet?

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

      Hi , don’t worry i am going to start a video series on test classes soon

  • @memesv3.093
    @memesv3.093 ปีที่แล้ว

    Hi Sir, Thanks for the explanation
    I wrote the code below for the scenario mentioned in this video (This code also works).
    Can you please let me know the drawbacks of this code as compared to yours
    trigger AccountTrigger on Account (after update) {

    Set accIds = new Set();
    if(Trigger.isAfter && Trigger.isUpdate){
    for(Account a: Trigger.new){
    accIds.add(a.Id);
    }

    List conList = [SELECT Id, Phone from Contact where AccountId IN: accIds];

    for(Account acc: Trigger.new){
    for(Contact con: conList){
    con.Phone = acc.Phone;
    }
    }

    update conList;
    }
    }

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

      Hi Buddy, 1. if your code is dependent on change of particular field then before record id in set you can apply a check on it like if(ac.Phone != null && a.phone != trigger.oldMap.get(a.Id).Phone)
      {
      accIds.add(a.Id);
      }
      2. null checks on the list which is being used in code to avoid null pointer exception.
      3. bulk updation

    • @memesv3.093
      @memesv3.093 ปีที่แล้ว

      @@sfdcninjas Thanks for the quick reply. Hope your channel becomes the most subscribed SF youtube channel

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

      thanks for your support buddy , keep watching