You need to sign in to do that
Don't have an account?
Scott Seong 2
Assign new lead to the original owner
We have a web-to-lead setup to create a new lead whenever a new Quote Request is made by web visitors regardless of where an email already exists in our SF instance. A new lead received from an existing customer will be treated as a new lead, and we would like to assign those existing customers to the same owner who service them before.
We've written a "before insert" trigger to search Account, Contact and non-converted Lead; and assign the newly created lead to the original owner. The trigger is working fine (from reviewing debug log).
We also have a Lead Assignment Rule, which uses "Lead Number" and "Round Robin ID" to assign leads to a selected few sales reps. The round robin rule works fine for new leads (non-duplicating email addresses), but for those existing emails assigned by the trigger (above) is reassigned by the Lead Assignment Rule.
Is there a way to create a Lead Assignment Rule, which bypasses the assignment if Owner already exists? We would like to keep the owner if it is already assigned by a trigger, and only assign via Round Robin rule if no owner is assigned by the trigger.
Any pointer is greatly appreciated.
We've written a "before insert" trigger to search Account, Contact and non-converted Lead; and assign the newly created lead to the original owner. The trigger is working fine (from reviewing debug log).
We also have a Lead Assignment Rule, which uses "Lead Number" and "Round Robin ID" to assign leads to a selected few sales reps. The round robin rule works fine for new leads (non-duplicating email addresses), but for those existing emails assigned by the trigger (above) is reassigned by the Lead Assignment Rule.
Is there a way to create a Lead Assignment Rule, which bypasses the assignment if Owner already exists? We would like to keep the owner if it is already assigned by a trigger, and only assign via Round Robin rule if no owner is assigned by the trigger.
Any pointer is greatly appreciated.
I believe before triggers execute before assignment rules are applied (according to the order of executions provided by Salesforce (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm))so this may work for you.
In the lead assignment rule, I created a first rule to check if AND(OwnerId<>null, OwnerID<>{ID of the default owner set in Lead Settings}). Having only (OwnerID, not equal to, null) rule end up assigning every lead to default owner. By combining, OwnerId<>null resolve the issue.
Thanks.
Step 1. Sort Order = 1
Step 2. Use "formula evaluates to true" with AND(OwnerId <> null, OwnerId <> {ID of the default owner set in Lead Settings}).
Step 3. Check "Do Not Reassign Owner".