+ Start a Discussion

What is handler and how does it works?

Hi All,

I'm trying understand how the handler works but I don't understand yet.

I want know what is handler and how does he works?

is there exist some document that explain how is it work step by step?

Amit Chaudhary 8Amit Chaudhary 8
Handler is nothing just a apex class. Where you can write your code and call other method in some order. Please check below post for trigger handler class
1) http://amitsalesforce.blogspot.com/2015/06/trigger-best-practices-sample-trigger.html

Let us know if this will help you
Hi Amit thanks for your reply,

let me make one more questions.

I have at least 4 trigger for the same object that execute a @future and call a web service method.
With this handler process, can I have only one trigger that execute 4 methods @future at same time?

For example I have to create 3 records in another system, so the trigger must execute 3 methods at same time. is it work?

Amit Chaudhary 8Amit Chaudhary 8
For you question . Yes you can control all in single trigger for all 4 future method.

As per trigger best pratice we should write only one trigger at a time because in mutliple trigger you can not control which one should execute first.
But with handler class you can control it.

Hi Amit,

Thanks, I gonna test here and I let you knowif works.

Best Regards