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
new_bienew_bie 

Assignment rules?

Hi 

 

I created a lead assignment rule

 

rulename--->Rule1

 

criteria-----> leadowner equlas to ABC

 

Assign to ---> (queue name) XYZ

 

As of my expections output is leadowner XYZ. but

after creating a lead record i found  leadowner ABC.

what is the problem?

 

Regards.

 

Best Answer chosen by Admin (Salesforce Developers) 
salesforce19salesforce19

Make sure this steps are followed once you have created assignment rules

1.) You need to active assignment rule.

2.) while creating a lead record you need to click on Assign using active assignment rule check box. If not assignment rules will not be triggered. 

All Answers

imutsavimutsav

The lead assignment rules will not work if you are inserting the leads through API. The assignment rules will work only if the leads are uploaded via web-to-lead form, or if you import the leads. When you Import the Lead at that time you get the option to 'Assign all the Leads using teis assignment rule' and you need to select your assignment rule from the picklist.

Thanks
Utsav

[Do mark this answer as solution if it works for you and give a kudos.]

salesforce19salesforce19

Make sure this steps are followed once you have created assignment rules

1.) You need to active assignment rule.

2.) while creating a lead record you need to click on Assign using active assignment rule check box. If not assignment rules will not be triggered. 

This was selected as the best answer
Prafull G.Prafull G.

In addition to what @raghusagar said, If you are using API to insert the Leads, You can set DMLOptions to define and execute the assignment rules.

Here is the syntax

Database.DMLOptions dmo = new Database.DMLOptions();

dmo.assignmentRuleHeader.assignmentRuleId= '01QD0000000IA2e'; // Active Assignment Rule ID

Lead newLead = new Lead(company='Test Company', lastname='Rule Test');

newLead.setOptions(dmo);

insert newLead;

 

Cheers!

new_bienew_bie
Hi

I made a small mistake while creating the lead record,
i didn,t check Assign using active assignment rule check box.


Thank you for your valuable sugetions.

Regards..