You need to sign in to do that
Don't have an account?
Nishh
Trigger fires when lead assignment rule matches the criteria
I have 2 queues on lead object 1. Custom assignment queue 2. Trask Queue
when queue is Custom assignment queue then trigger fires and matches Account with lead's company name field and if single match found then lead converted to contact.
And if it found multiple matches with account and company name then it will go to trask queue
Any help?
Hi Nishh,
Try the following trigger to acheive this,
trigger CheckQueuesToConvert on Lead (after insert, after update) {
for(Lead l: Trigger.New){
if(l.ownerId == <Custom assignment queue>){
List<Account> acc = [select id,name from Account where Name =: l.Company];
if(accList.Size() > 0){
if(accList.Size() == 1){
//Your Lead Convert statement here
}
else{
l.ownerId = <Trask Queue ID> ;
}
}
}
}
}
Hope this will help you...!
Please don't forget to give kudos and mark this as a solution, if this works out.
Hi Nish,
Also see the links for further info,
http://salesforce.stackexchange.com/questions/13651/lead-assignment-rule-in-a-trigger
http://robstechnotes.blogspot.com/2011/08/creating-apex-trigger-in-salesforcecom.html
Regards,
Ashish