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 

Recommend Approach for Lead Trigger Invocations from Assignment Rules?

Hi,

We are having difficulty avoiding governor limits in a lead trigger. The problem is how Saleforce invokes the trigger when assignment rules are executed. I have a case where 36 leads have their owner changed by the assignment rules. The trigger is then invoked *separately* on each lead rather than invoked in bulk. This results in the trigger being called more than 36 times. After the trigger is invoked on the leads individually, it appears that the trigger is then invoked one more time in batch mode on all the leads. There must be some kind of mechanism to detect and ignore the individual invocations and then to detect when the final bulk trigger invocation is occuring so the trigger can execute then. I can't see any way to do this however. Could somebody please advise?

Thanks,

Mike