+ Start a Discussion
V AnandV Anand 

Which is first executed before trigger or assignment rule?

For the change of owner of the lead record

I Created assignment rule and "before insert" trigger for lead assignment.

If I check the checkbox of assignment rule when new lead is created lead is assigned to Queue through the lead assignment rule,  Trigger  not fired.

If I uncheck the checkbox of assignment rule when new lead is created  trigger fired.

What's the problem to trigger. How can I fire ?

sanjdevsanjdev

Hi Please follow below link for details order of execution .

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm

 

If I check the checkbox of assignment rule when new lead is created lead is assigned to Queue through the lead assignment rule,  Trigger  not fired.--- Answer to this statement. Since assignment rule works after trigger, it is overriding the logic of trigger.

 

Mark it as resolved if it helps you.

Cheers