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
TehNrdTehNrd 

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.

Thanks,
Jason
werewolfwerewolf
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
TehNrdTehNrd
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.

-Jason


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

http://ideas.salesforce.com/article/show/10094219/Invoke_Assignment_Rules_with_Apex#skin=le
arasuarasu

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

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