ForceChallenges
ProblemsDailyNotesInterview
Sign in

Practice

All problemsSOQL practiceApex trigger challengesDaily challengeOpportunityTrigger.oldMapBefore UpdateBulkificationContactValidationGROUP BYSemi-JoinAccountBefore Insert

Interview questions

All questionsAdminAdministrationApexApex TriggerAsync ApexDevelopmentField ServiceField ServiceIntegrationLwc

By company

DeloitteSalesforceAccentureInfosysPwCCognizant

Learn

Study notes

ForceChallenges

AboutContact usPrivacy PolicyTerms of ServiceFor AI assistants (llms.txt)
© 2026 ForceChallenges · Salesforce SOQL & Apex trigger practice
Sales Cloud questions59 of 79
Sales CloudMedium 2 min read

What is the function of Lead Assignment Rules in streamlining inbound sales pipelines?

Answer

Basics: They route leads by criteria such as country, state, company size, lead source or any field. Only one lead assignment rule can be active at a time; each rule has numbered entries evaluated in order, and the first matching entry assigns the lead. If no entry matches, the lead goes to the default owner (for example the Web-to-Lead default lead owner or the creating user).

How it works: Setup > Lead Assignment Rules > New. Add entries with an order number, criteria (field filters or a formula), the assignee (user, queue, or related user), and an email template to notify the new owner. Activate the rule. Rules run when: a Web-to-Lead form submits (when a rule is active), a user checks "Assign using active assignment rule" on the lead page or in the Data Import Wizard/Data Loader options, or code sets the assignment rule header.

Advanced / deep dive: Entries are evaluated top to bottom, and a final catch-all entry (no criteria) is a common safeguard. Queues must support the Lead object. Native assignment is criteria-based only; true round robin, load balancing or capacity-based routing requires Flow/Apex (round-robin counters), Omni-Channel-style tools or a lead-routing package. Territory-based assignment is a separate feature. Rules do not run on every update; reassign on edit only when the checkbox or header is used. In Apex use Database.DMLOptions dmo = new Database.DMLOptions(); dmo.assignmentRuleHeader.useDefaultRule = true; Database.insert(leads, dmo); and in the REST/SOAP API the Sforce-Auto-Assign header. Record-triggered flows that create leads do not automatically apply assignment rules unless you design for it, so verify behavior for your channel. Entry counts and criteria complexity have limits (verify current documentation). Case assignment rules are a separate, similar feature.

Code / config example:

apex

List<Lead> leads =  <Lead>{
     (LastName = , Company = , Country = ),
     (LastName = , Company = , Country = )
};
Database.    .DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = ;
dmo.emailHeader.triggerUserEmail = ; 
Database.SaveResult[] results = Database.insert(leads, dmo);
Practice SOQL & Apex
PreviousWhat is lead conversion in Salesforce Sales Cloud, and what records are created during this process?Next How do Sales Cadences enforce structured multichannel outreach for sales representatives?

More Sales Cloud questions

  • How does the account merge mechanism consolidate duplicate enterprise accounts and associated child records?
  • Why is defining structured lead status lifecycles essential for accurate sales funnel measurement?
  • What are the operational boundaries and best practices for sending mass list emails within Sales Cloud?
  • How can screen flows be utilized to build custom guided selling flows directly on opportunity pages?
  • How do approval processes automate complex discount and deal desk sign-offs in Sales Cloud?
// Apply the active lead assignment rule from Apex (bulk-safe)
new
List
new
Lead
'Rao'
'Acme'
'India'
new
Lead
'Smith'
'Globex'
'USA'
DMLOptions
dmo
=
new
Database
true
true
// notify new owner

Hidden gotchas & must-remember points:

  • Only one lead assignment rule can be active at a time.
  • Rules do not fire automatically on every create or update; you must trigger them.
  • First matching entry wins, so order matters.
  • Unmatched leads fall to the default owner, so add a catch-all entry.
  • There is no built-in round robin.
  • Apex or API inserts ignore rules unless the assignment header is set.

Best practice: Keep entries ordered from most to least specific with a catch-all, and trigger the rule explicitly from every lead source (Web-to-Lead, imports, Apex, integrations).

Sales CloudLead ManagementAssignment Rules