Trigger Action Framework

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 เม.ย. 2021
  • Orchestrate ALL of your Salesforce Automation with the Trigger Actions Framework

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

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

    One of the best videos I've ever seen about Salesforce and Apex! Huge thanks, it will be very helpful. Greetings from Colombia!

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

      Glad you enjoyed it! Amit Chaudhary

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

    My Favorite channel since many years . Its not for Indian but worldwide people are big FAN of it.

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

      Thanks, It simple make my day. From Amit Chaudhary

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

      @@apexhours 🤟

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

    Very very helpful and interesting architectural point of view implementation! The way to code. Thank you very much, Mitch.

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

      Glad it was helpful!

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

    Thank you Mitch , Simple, neat and reusable code for a complex trigger framework

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

      Glad it was helpful!

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

    Really awesome. Covers everything from recursion, execution control, bypass logic, bulkification, modularization to Singleton pattern. Golden feather in my Read it > Repeat It list . Thank you #MitchellSpano #Apexhours

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

      Glad you like it!

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

    How would the flow being triggered cope with the 2000 element governor limit for larger data volume? I was working on implementing something similar but haven't figured out a way around that yet. Best I've come up with so far is to create an individual interview per record which is basically how record triggered flows work but the important difference is that flow interviews launched from apex aren't automatically bulkified so while it would address the 2000 element issue it would also make it so you couldn't do soql/dml in the flow (which could be ok as long as they were designed to work that way and there was a way to make sure the record(s) to soql could be done in bulk and then passed along to the flow as an input and the ones to be updated could be added to a collection by the apex after the completion of each interview.

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

    Awesome! I was looking for this one. Thank you.

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

      Glad I could help!

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

      Super agree!

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

      @@apexhours I have one question though, if few developer working on trigger of the same object and they are writing different actions but they given same order for the action, how we are going to handle this? for some reason if we need to change the order, we have to re-order all of the action, is there a way to handle this? Thank you.

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

      @@starman9000 note that the order is not an integer, it has 3 decimal places. This is to help prevent having to shift the order of all triggered actions when a new one is inserted. Try to use the number to the left of the decimal point as a "Team prefix" to group like functionality together. Also, I would recommend putting some space between the order of your trigger actions to make room for future actions.

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

      @@mitchspano Thank you, I have noted, when I implement will come to an handy tip.

  • @singh.deepak90313
    @singh.deepak90313 3 ปีที่แล้ว +1

    In one word ---- awesome.

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

      Keep watching

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

    Amazing video, very informational.

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

      Glad it was helpful!

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

    Superb 👍, Thanks Mitch Spano.

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

      Glad you liked it!

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

    Just one word... incredible.

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

      glad you like it

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

    this is an awesome framework for Trigger Handling. Just curious on the flows support. In the order of execution - my understanding is Flow Before Insert will be executed prior to Trigger Before Insert. But with this logic we are trying to first trigger logic to be executed then circle back to Flow path. Is there any downstream impact due to changing the order of execution flow.

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

    TA apex class , should be one for one sObject? or every time I have new logic to be excecated on any event(context variable) for one sObject then need to create new TA apex class for new method? Very very helpful session, already implemented in my client's SB. Thanks very much...

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

    Thank you, it's really cool and useful framework.

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

      You are welcome!

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

    Great Content to learn... Thanks #MitchellSpano for sharing your knowledge.
    Also Thanks to entire #Apexhours team for providing Salesforce Content for free.

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

      Thank you so much. Keep watching

  • @abdel-azeezsabra5889
    @abdel-azeezsabra5889 ปีที่แล้ว +1

    Thanks for sharing @MitchSpano. I have one question: Why are you using two variables for Recursion Prevention?. I think one is enough

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

      We will check with speaker and get back to you

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

    How do we manage the Scheduled Path of Flow using the Trigger Action Framework?

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

    This framework looks promising. Only issue I see at the moment is to share the SOQL's between two individual classes. How do we solve it?

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

      Use Selector pattern for sharing SOQL between different classses

  • @akashkumar-hi7pp
    @akashkumar-hi7pp 3 ปีที่แล้ว +2

    I really liked the video. Thanks Mitchell Spano and Apex hours for bringing this up. I had one query on this framework - We are using separate classes for each of the actions with a specific trigger context for e.g. before insert. Is that fine from an architecture point of view?
    #MitchellSpano

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

      Glad it was helpful!

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

      Try using the Framework to partition at the action level instead of the context level!

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

    This is awesome, I am planning to have same logic in flows, is that fine?

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

      With this framework, you can use flows or Apex or both.
      Try to delegate the more complex tasks to Apex but leave the simple declarative things to Flow.

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

      Thanks @Mitch for your help

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

    excellent content. what if has same logic needs to be execute in two different trigger actions like afterInsert & afterUpdate?

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

      Write one class which implements both interfaces, then one piece of custom metadata for each context to define the order of execution within the given context for the sObject.

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

      Thanks @Mitch for your help

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

    I think it's a very good model.
    Too many classes make it less maintainable?
    We can probably use function names instead of class names with little modifications in the metadatatriggerhandler class

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

      Glad you like it

  • @singh.deepak90313
    @singh.deepak90313 3 ปีที่แล้ว +2

    instead of metadata can't we use the custom objects?

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

      Metadata stay in cache and soql not counted against your governor limit

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

      Metadata can also be stored in source and is populated in a sandbox after refresh

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

    How order of execution has been taken care? Where is the code for that?

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

      Take a look at the MetadataTriggerHandler class - we query for the configured actions for the current context and order them by the Order field.

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

      Let us know if you need more details

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

    Avoid Repeated Queries - The sample code written in this section was ever tested ? Because it seems to be not working. I am getting this runtime error :
    System.TypeException: XXXXXXX does not have a no-arg constructor:
    Any idea why ?

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

      If you look in the example, there's an inner class called 'Service'; you need to set the custom metadata to have an Apex Class Name of 'TA_Opportunity_Queries.Service'.
      The inner class is a necessary workaround to avoid the error you error you experienced. This error is caused when you try to dynamically instantiate an object of a dynamic type when that class has a private constructor - like all singleton implementations have.

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

    Well that was great effort from Mitch but this approach seems to be difficult to explain it to developers. I believe only pro developers can understand and implement it in smooth way. #mythoughts