Sub topic 2
Lead Status, Lead Source, and the Converted Status
This chapter covers two picklist fields on the Lead object, Lead Status and Lead Source, and the special "converted" status that makes conversion possible. It assumes you can navigate Setup and Object Manager, know the Account, Contact, and Opportunity objects, and can read basic SOQL and Apex.
Two fields, two questions
Lead Status answers "Where is this lead in my process right now?" Lead Source answers "Where did this lead come from?"
| Field | Changes over time? | Typical values | Used for |
|---|---|---|---|
| Lead Status | Yes, as reps work the lead | Open - Not Contacted, Working - Contacted, Closed - Not Converted, Closed - Converted | Process tracking, list views, conversion |
| Lead Source | Rarely, usually set once at capture | Web, Phone Inquiry, Partner Referral, Purchased List | Marketing attribution and reporting |
Both are picklists, so an admin controls the allowed values. Lead Status is required on every lead. Lead Source is optional unless you make it required.
Lead Status and the converted flag
Lead Status values are not ordinary picklist entries. Each value carries a flag that says whether it represents a converted lead. You can see this on the Lead Status values page in Setup, where each value has a Converted checkbox.
- A value with Converted checked can be used only during conversion. Users cannot pick it by editing the Status field on an unconverted lead.
- At least one value must be marked converted. Without one, nobody can convert a lead, and
Database.convertLeadfails. - You can have several converted values, for example one for "Converted - Sales Ready" and one for "Converted - Nurture". The user picks one in the conversion screen.
Each status also has a Closed attribute in the standard statuses. Reports that count open versus closed leads rely on it.
Setting up values
- In Setup, open Object Manager, then Lead, then Fields & Relationships, then Lead Status.
- In the Lead Status Picklist Values section, add or edit values.
- Mark the converted value or values.
- If you use record types or sales processes for leads, check which values each one exposes. A status missing from a record type's picklist cannot be chosen for leads of that type.
Removing or renaming a value that is already in use affects existing records and reports. Replace the value for existing leads before you delete it.
Lead Source and reporting
Lead Source is copied during conversion. The standard mapping carries it from the lead to the opportunity, so you can report on which channels produce revenue, not just leads. Keep values consistent, because free variation such as "web", "Website", and "Web Form" splits your report groups.
Two practices help:
- Keep the picklist short and agree on definitions with marketing.
- Set Lead Source automatically in capture channels. For Web-to-Lead, add a hidden field with the right value in the form.
Seeing the values in SOQL
You can inspect which statuses are marked converted by querying the LeadStatus object.
SELECT MasterLabel, IsConverted, SortOrder
FROM LeadStatus
ORDER BY SortOrderYou can also group your leads by source and status to see where they sit.
SELECT LeadSource, Status, COUNT(Id) total
FROM Lead
GROUP BY LeadSource, Status
ORDER BY LeadSourceCommon errors
- No converted status exists. The conversion screen shows no status to choose, or Apex throws an error. Add and mark a converted value.
- Wrong status picked in code. Apex must pass a converted status label to
setConvertedStatus. An unconverted label causes a failure. - Reports show "Closed - Converted" leads as open. Check the status definition. Reports use the converted flag, so a custom value that is not flagged is treated as unconverted.
- Inconsistent Lead Source values. Imports and forms with free text values split reports. Restrict the picklist or use validation rules.
Exercise
A rep says the Convert button works, but the status dropdown on the conversion screen is empty. Another admin wants to know if you can fix it by adding a normal "Converted" value to the Lead Status picklist. What do you do, and why?
Show answer
Adding a value is not enough. Open the Lead Status values in Setup and check the Converted box on a value, either an existing one or a new one. The conversion screen lists only values flagged as converted, so a value with the word "Converted" in its label but without the flag will not appear.
Exercise
Write a SOQL query that returns the converted status labels, so an Apex class can pick one for setConvertedStatus.
Show answer
SELECT MasterLabel FROM LeadStatus WHERE IsConverted = true