+ Start a Discussion

How can I enforce Lead Assignment Rules to run on Lead inserts?

If I insert a Lead with apex I don't always want the context user to be the owner of the lead created. Rather it should be processed by the assigment rules. Please tell me this is possible and I just overlooked it somewhere.

Unfortunately it is not yet possible to run assignment rules from Apex.  I've also been bitten by this on cases.

Message Edited by werewolf on 11-09-2008 12:16 PM
Gah! This definitely throws a monkey wrench in to our PRM 3.0 implementation.

Here is our use case for having this feature:

We get a lot of leads when we do trade shows, more than we can handle, our inside sales team takes the really hot ones, but then we want to pass some of these leads off to our partners. We will upload these leads into the partner portal and then they can follow up on these prospects. If a prospect turns out to be a legit deal there will then be a button which then launches a visual force page. This page asks for additional information necessarily for a deal registration. Upon submission of this form the code would change the record type to a Deal Registration, grant the portal user visibility to this record, and then automatically run the assignment rules so the deal reg is then assigned to the correct ISR. I would have loved for this to be completely automated, but unfortunately it looks like this process will require manual intervention to run the assignment rules. I will have to send then Deal Reg to a queue and then have a user edit and select the Run Assignment Rules checkbox.

With Force.com sites on the way I would think this feature should really be on the road map as I can see the potential of building your own lead capturing page rather than the html based web-to-lead and you will need an easy way to assign these leads.


Message Edited by TehNrd on 11-09-2008 07:20 PM


Hi there,

The assignment rules on Account does get recalculated or activated when you create new Accounts from Apex Triggers. But at the same time, I noted that the Account "updates" from Apex triggers..do not  recalculate the assignment rules. Is this a bug?

Thanks and regards

Not sure what you're talking about arasu.  Assignment rules only apply to leads and cases.