Trigger Action Framework

Sdílet
Vložit
  • čas přidán 2. 04. 2021
  • Orchestrate ALL of your Salesforce Automation with the Trigger Actions Framework

Komentáře • 57

  • @sushmamaurya5083
    @sushmamaurya5083 Před 2 lety +2

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

  • @sebastianmolinares6833
    @sebastianmolinares6833 Před 3 lety +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  Před 3 lety +1

      Glad you enjoyed it! Amit Chaudhary

  • @dharmeshrana7548
    @dharmeshrana7548 Před 3 lety +4

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

  • @chatoanil
    @chatoanil Před 2 lety +1

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

  • @sheetalchougule8832
    @sheetalchougule8832 Před 3 lety +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

  • @starman9000
    @starman9000 Před 3 lety +3

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

    • @apexhours
      @apexhours  Před 3 lety

      Glad I could help!

    • @edbienes
      @edbienes Před 3 lety

      Super agree!

    • @starman9000
      @starman9000 Před 3 lety

      @@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 Před 3 lety +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 Před 3 lety

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

  • @raz5802
    @raz5802 Před 3 lety +1

    Just one word... incredible.

  • @singh.deepak90313
    @singh.deepak90313 Před 3 lety +1

    In one word ---- awesome.

  • @prakashtiwari2570
    @prakashtiwari2570 Před 3 lety +1

    Superb 👍, Thanks Mitch Spano.

  • @ingaovsiannikova8831
    @ingaovsiannikova8831 Před 6 měsíci

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

  • @jimconingsby2386
    @jimconingsby2386 Před 2 lety

    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.

  • @lovedeepsingh8702
    @lovedeepsingh8702 Před 3 lety +5

    Amazing video, very informational.

  • @mahigenny687
    @mahigenny687 Před rokem

    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 Před 2 lety

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

  • @anjaneyuluvajja9926
    @anjaneyuluvajja9926 Před 3 lety +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  Před 3 lety

      Thank you so much. Keep watching

  • @abdel-azeezsabra5889
    @abdel-azeezsabra5889 Před rokem +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  Před rokem

      We will check with speaker and get back to you

  • @jheelmonty
    @jheelmonty Před 2 lety

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

  • @krupakarreddyj2918
    @krupakarreddyj2918 Před 3 lety +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  Před 3 lety +1

      Use Selector pattern for sharing SOQL between different classses

  • @akashkumar-hi7pp
    @akashkumar-hi7pp Před 3 lety +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  Před 3 lety

      Glad it was helpful!

    • @mitchspano
      @mitchspano Před 3 lety +1

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

  • @sivadandamudi365
    @sivadandamudi365 Před 3 lety +1

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

    • @mitchspano
      @mitchspano Před 3 lety +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  Před 3 lety

      Thanks @Mitch for your help

  • @ragulhm
    @ragulhm Před 3 lety +2

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

    • @mitchspano
      @mitchspano Před 3 lety +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  Před 3 lety

      Thanks @Mitch for your help

  • @NagaVivekeverwin
    @NagaVivekeverwin Před 2 lety +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

  • @singh.deepak90313
    @singh.deepak90313 Před 3 lety +2

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

    • @apexhours
      @apexhours  Před 3 lety +1

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

    • @mitchspano
      @mitchspano Před 3 lety

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

  • @shivmahla4988
    @shivmahla4988 Před 3 lety +1

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

    • @mitchspano
      @mitchspano Před 3 lety +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  Před 3 lety

      Let us know if you need more details

  • @anupamdutta2348
    @anupamdutta2348 Před 3 lety +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 Před 3 lety +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 Před 2 lety

    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