Run the free scan

RoutedAll guides

How to test a lead assignment rule before it goes live.

Free check of your Salesforce or HubSpot routing. It runs in your browser.

An assignment rule that looks right on screen can still send leads to the wrong place. Test it with real records before anyone depends on it. Do it in a sandbox, not in production.

Run the rule on a test lead

  1. Create a lead in the sandbox with values that should match one entry.
  2. On the lead edit page, tick the option to assign using the active assignment rule, then save.
  3. Read the owner. It should be the owner of the entry you aimed at.

To do this for many leads, use Apex. The line that tells Salesforce to run the rule is below.

Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true;
Database.insert(testLeads, dmo);

What to test

What the test will not show

A flow can change the owner after the rule runs. A test that reads the owner at once will miss it. Read the owner again a minute later. See a flow overriding the rule.

Clean up

Delete the test leads. Then export the configuration and check it for entries that can never match. See how to export it.

Writing a new entry? Check it before you save it.

A test plan to copy

The values below are made up. Swap in the values your own entries test.

A test plan to copy
Test leadValuesExpected owner
Aimed at entry 1Country France, source WebThe owner of entry 1
Matches two entriesValues from entry 1 and entry 3The owner of entry 1
Matches noneA country no entry namesThe default owner
Blank countryNo country valueThe default owner, or a named entry

Entries that overlap are covered in entry order.

Record the result

  1. Write the owner you got beside the owner you expected.
  2. Read the owner again after a minute, in case a flow changed it.
  3. For each mismatch, open the entry and read its criteria again.
  4. Fix one entry, then rerun that test lead before the next.

Keep the table with your change notes. The audit checklist asks for the rule as it was before and after a change.

The free scan checks your export for:

The routing health checklist17 checks, from the rules to the handoff.
Open it

Have it checked every night instead.

Routing Forensics connects as a read-only user and checks this, and the rest of your routing, against your real leads. Three design partners get a free health report on their own CRM, free for 90 days: what is leaking, where, and what it is worth. Apply for a place.

Or check it now. The free scan reads your Salesforce export in your browser. Nothing is uploaded.

Apply for a free place without leaving this page. We ask for a read-only user, a named owner and a short regular call.

We use this only to reply. Privacy notice.

More guides