Activity Forums Salesforce® Discussions Why Trigger is mandatory to write in handler class in Salesforce?

  • MOHIT

    Member
    February 20, 2020 at 2:21 pm

    However, think about it. Since triggers doesn’t have separate methods, if we put multiple logic into one single trigger, it can be really messy. Now we have only two triggers combined together, it can already become messy and less readable.

    That’s the main reason we want to introduce TriggerHandler class. In Salesforce, the good practice is to keep Trigger free with actual business logic and put the logic code into TriggerHandler class.

  • Anjali

    Member
    February 20, 2020 at 2:24 pm

    The good practice takes it into consideration that the trigger should be logic free and the logic code must be included in TRiggerHandler class.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos