+ Start a Discussion
V AnandV Anand 

How to change owner when owner is queue?

I am facing problem with trigger,  I created a Queue  and this Queue is assigned to lead assignment rule.
I created a tirgger on lead object.
 That trigger was written that executes at new lead creation. That trigger first checks to see if the new lead is owned by the perticular  queue. 


I wrote lile this

trigger ddd on Lead (before insert) {


 for(Lead l:trigger.new){





but trigger not fired.colule you please help me to achieve this..

Best Answer chosen by Admin (Salesforce Developers) 



Your Trigger is executing but condition if(l.ownerid=='00G90000000OTUm')) will never be true


Since Assignment Rule executes after Trigger executiion. Logic that you have mentioned below will not work.


Mark it as resolved if it helps you.