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
lopezclopezc 

Can "Assign using active assignment rule" check box been used in trigger?

Hi

My org has an active lead assignment rule, a user can choose to assign an existing lead using said active assignment rule by editing the lead. 

If that is the case the lead is assigned accordingly following the assignment rule otherwise we have another logic in place to assign users using round robin.

 

Now, I don't know how to check in the after insert/update lead triggers if the user ticked  "Assign using active assignment rule" checkbox. 

At the moment, regardless the user ticks that checkbox or not, we always assign using round robin, however this is not what the user wants.

 

Please help!

sfdcfoxsfdcfox

There is a way to view the DML options on an SObject, but it appears that it is always nulled out. Perhaps this will be corrected in the future. Your trigger cannot determine if ownership changes as a result of an assignment rule, as they process after all triggers are finished.