function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mikeegarmikeegar 

How to Disable Assignment Rules in a Trigger?

Hi,
    Is there any way to stop Assignment Rule execution from inside a Trigger? I am writing a Lead Trigger that needs to do the following:
 
perform a calculation to determine the ownership of the lead object
If an owner is found
     Assign the Lead
Else
     Assign through the regular Assignment Rules.
 
The Assignment Rules could be prevented from executing by setting a checkbox or some field that could be added to the criteria of all Assignment Rules. This solution is not ideal however and can be problematic when an org has a large number of rules.
 
Is there a better way to do this?
 
Thanks,
Mike
 
 
mhamberg1mhamberg1

We are also looking for a solution to this as we have zip code-based rules.

 

Does anyone know?