Apex Trigger Framework Salesforce

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024
  • Want to learn more about salesforce join me at sfdcpanther.com Hi Trailblazer,
    In this video, we are going to learn all about Apex Trigger Framework.
    What/Why to use Trigger Framework
    Helps you to conform to the Best Practices
    Simply testing and maintaining the application logic is very easy
    Assure Order of Execution
    Prevent the Recursion
    Error handling makes very easy
    Link to Code: - 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
    All About Trigger Handler - • All About Trigger Hand...
    Rollup Summary Trigger - • Rollup Summary Trigger...
    Duplicate Contact Trigger - • Duplicate Contact Trig...
    Collection in Salesforce - • Introduction to Set & ...
    SOQL in Salesforce - • SOQL in Salesforce || ...
    OAuth 2.0 - • An Overview to OAuth 2...
    #SalesforceForBeginner #Salesforce #ApexTrigger
    #JourneyToSalesforce

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

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

    Hi Amit , you have not discussed, how can we avoid recursion using trigger framework , please elaborate the same

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

    Found this very helpful, thankyou so much

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

    I just love ur video...Big fan.your videos mostly give ans for evry possible case

    • @sfdcpanther
      @sfdcpanther  4 ปีที่แล้ว

      Thank for your feedback 👍

  • @asish681
    @asish681 2 ปีที่แล้ว

    Thanks for this video, It's really informative

  • @harshpanchamiya6533
    @harshpanchamiya6533 3 ปีที่แล้ว

    Mind blowing concept, enjoyed learning it.
    One concern though, you have not discussed how can we avoid recursion using trigger framework. Please explain that if possible.

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

    How come the handler classes have static method but in dispatcher we are able to call them from handler instance

  • @inboxoutbox2697
    @inboxoutbox2697 2 ปีที่แล้ว

    Amit, I just want to understand something, at 3:43 you said that the logic won't work for the next 200 records in case of a dml of bulk (data loading tools or batch apex), since the static variable becomes true. Please correct me or help me understand. Here you are referring to the trigger batch size of 200 isn't it? If not which governor limit are you referring to?

  • @manishmahajan7613
    @manishmahajan7613 2 ปีที่แล้ว

    Great video. Anything on recursion and on/off flag if trigger is disabled please? It would make it complete

    • @sfdcpanther
      @sfdcpanther  2 ปีที่แล้ว

      Recursion is something which is different from company to company but yes I will share a newly created framework which I am working on ASAP which have many things and is much easier and faster in working.

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

      @@sfdcpanther did you create video for that if yes please share the link

  • @rameshakkineni
    @rameshakkineni 3 ปีที่แล้ว

    Quick quesiton - How are we able to access 'Trigger.new' in TriggerDispatcher class? What happens when triggers on multiple objects are fired at the same time? What does 'Trigger.new' contain in that case? Are triggered queued if multiple triggers on different objects are fired at the same time?

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

      Hello, when you are invoking a class from trigger you can access all the trigger context variable inside that class and depending upon Which object is calling that class trigger.new will contain the data for that object

    • @rameshakkineni
      @rameshakkineni 3 ปีที่แล้ว

      @@sfdcpanther Makes sense. Thank you so much for the clarification

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

      To clarify this concept in depth, Context Variable of System.Trigger get their value when a trigger is start executing until it finish executing. When a trigger is executing it set the context variable on current context, so during trigger execution time if you call a apex class method those values are available as long as trigger is executing
      So basically if trigger call a class method means trigger still executing and you can have context variables for it

  • @lukkypadmavathi3782
    @lukkypadmavathi3782 3 ปีที่แล้ว

    what is apex trigger execution pattern in salesforce

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

    I guess framework should be abstract class type in interface base u have to implement all the methods. Let's say on email message object i want one to run in afterinsert then why should we implement all the methods

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

      It depends upon business to business however recommended one is always interface reason being every developer and teams are using the same way to develop the code otherwise everyone will use their own way and it will create tech debt at one day which lead to other bigger issues

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

    Hi Amit
    could you please provide credentials so that we can see the code

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

      You will get the link to GitHub gist where you will get the code . There is complete code

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

      @@sfdcpanther OK thanks

  • @pavanpalleti8580
    @pavanpalleti8580 4 ปีที่แล้ว

    u removed all the code from trigger and created an extra Handler for each object in addition to the Helper. .... !! how is this reducing the logic ??

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

      The concept of helper and handler is to increase the readability and reusability of the code. Now you can call the same code from various handler and this will reduce the no of lines in your code which Also leads no to writing the Big test class and that will descrease the deployment time.
      There are so many factors not only one.