Sub topic 2
Lead Status, Lead Source, and the converted status
This chapter covers the two picklists that describe a lead's progress and origin, and the special role one Lead Status value plays during conversion. It assumes you can navigate Setup and Object Manager, know the standard objects Account, Contact, and Opportunity, and understand profiles and permissions at a basic level. The Apex and SOQL snippets need only basic syntax knowledge.
Two picklists, two questions
Every lead answers two questions that reports rely on.
- Where did this lead come from? That is Lead Source (
LeadSource). - How far along is it? That is Lead Status (
Status).
Both are picklist fields. A picklist is a field that limits input to a defined list of values. Lead Source is a standard picklist shared with other objects, including Opportunity and Contact. Lead Status is specific to leads and has extra behavior tied to conversion.
| Field | API name | Question it answers | Shared with other objects | Affects conversion |
|---|---|---|---|---|
| Lead Source | `LeadSource` | Where did the lead originate? | Yes (for example Opportunity, Contact) | No, but it can be mapped to converted records |
| Lead Status | `Status` | Where is the lead in the qualification process? | No | Yes, through the converted flag |
Lead Source
Typical values are Web, Phone Inquiry, Partner Referral, Purchased List, and Other. Salesforce supplies defaults, and you can edit them under Setup > Object Manager > Lead > Fields & Relationships > Lead Source.
Keep these points in mind:
- Source is about origin, not channel of the current conversation. A lead from a trade show stays "Trade Show" even if a rep later reaches them by phone.
- Keep the list short and mutually exclusive. If two values could describe the same lead, reports split the same kind of lead across two rows.
- Lead Source carries over on conversion. By default,
Lead.LeadSourcemaps toOpportunity.LeadSourceandContact.LeadSource, so you can later report on which sources produce revenue. Mapping is covered in a later chapter. - Web-to-Lead can set it. A hidden field in the generated form can fill
LeadSourcewith "Web" or a campaign-specific value.
Lead Status
Lead Status tracks the lead through your qualification process. A common default set looks like this:
- Open - Not Contacted
- Working - Contacted
- Closed - Not Converted
- Closed - Converted
Unlike a plain picklist, each Lead Status value carries properties that Salesforce reads. You manage them under Setup > Object Manager > Lead > Fields & Relationships > Status. The values appear in a related list of Lead Status Picklist Values, where each one has a Converted checkbox.
The converted status
A value marked Converted is the status Salesforce assigns to a lead once it has been converted. Three things follow from that.
- At least one converted value must exist. Conversion requires you to pick one. If none exists, the conversion cannot proceed.
- A converted lead is read-only in practice. After conversion, the lead's
IsConvertedfield istrue. Standard users cannot edit the lead, and the record is no longer shown on the usual lead conversion screen. - You choose the value at conversion time. The Convert Lead page shows a Converted Status picklist containing only values flagged as converted. In Apex, you pass the value with
setConvertedStatus.
You can have several converted values, such as "Qualified - Converted to Opportunity" and "Qualified - Account Only". The user or code picks whichever fits.
Unconverted values and how they behave
Values without the Converted flag are ordinary working statuses. They can be selected freely while the lead is open. Salesforce does not enforce an order, so a lead can move from "Open - Not Contacted" straight to a closed value. If you need to force a sequence, use a validation rule or a Sales Path, not the picklist alone.
Default value and record types
You can set a default Lead Status, which is applied to new leads when no value is supplied. If you use record types on Lead, each record type has its own list of available Lead Status values, so confirm that every record type includes at least one converted value. A record type that exposes no converted value leaves users unable to convert leads of that type.
How the status moves through a lead's life
The diagram shows a typical path. Salesforce allows jumps between open statuses, but this is the usual flow.
Only the transition into Converted creates records. Moving into "Closed - Not Converted" simply ends the lead's active life, and the lead stays in the database as an unconverted record.
Reading status and source with SOQL
Both fields are queryable like any other field. The converted flag on the status is exposed through the LeadStatus object, which the conversion code in a later chapter relies on.
SELECT Id, MasterLabel, IsConverted, IsDefault, SortOrder
FROM LeadStatus
ORDER BY SortOrderMasterLabel is the value's label, IsConverted is the Converted checkbox, and IsDefault marks the default. You can also group leads by source and status to see your pipeline quickly:
SELECT LeadSource, Status, COUNT(Id)
FROM Lead
WHERE IsConverted = false
GROUP BY LeadSource, Status
ORDER BY LeadSource, StatusThe IsConverted = false filter matters. Converted leads are hidden from most list views and the default Leads tab, but they still exist, and a query without the filter includes them.
Selecting the converted status in Apex
The conversion call needs a valid converted status label. Query it rather than hard-coding a string, because administrators can rename values.
LeadStatus convertStatus = [
SELECT MasterLabel
FROM LeadStatus
WHERE IsConverted = true
LIMIT 1
];
System.debug('Converted status: ' + convertStatus.MasterLabel);This query returns an arbitrary converted value when several exist. If your process distinguishes between them, filter on a specific MasterLabel or store the chosen value in custom metadata.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Convert Lead page has an empty Converted Status picklist | No Lead Status value has the Converted flag, or the lead's record type does not include one | Mark at least one value as Converted and add it to the record type |
| Apex conversion fails with an invalid status error | The label passed to `setConvertedStatus` is not flagged as converted | Query `LeadStatus` where `IsConverted = true` |
| Query returns `null` for the status query in Apex | No converted value exists in the org | Create one, and handle the empty result in code |
| Reports show the same source twice | Near-duplicate Lead Source values such as "Web" and "web site" | Merge the values and update records |
| Users cannot pick a status they expect | The value is missing from the record type or profile-specific picklist settings | Add the value to the record type |
| Deleted or renamed status values cause odd report groupings | Existing leads still hold the old value | Replace the value, which reassigns existing records to a new one |
Replacing and deactivating values
Salesforce offers two ways to retire a picklist value.
- Deactivate the value. It disappears from the picklist for new entries, but existing records keep it.
- Delete the value, choosing a replacement. Existing records are updated to the replacement.
For Lead Status, replacing a converted value is the more delicate case, because you must always leave at least one converted value active. Plan the new converted value first, then retire the old one.
Practical guidelines
- Define the meaning of each status in one sentence and publish it. Reps use statuses inconsistently when definitions are vague.
- Keep open statuses to about four or five. More than that tends to produce statuses that nobody can tell apart.
- Use validation rules for rules like "a lead cannot be Working - Contacted without a phone call logged".
- Use Lead Source for origin and Campaign membership for specific marketing programs. Mixing the two makes source reporting noisy.
- When migrating data, load Lead Source and Lead Status values first as picklist values, so imports do not fail on unrecognized entries.
Exercise
An administrator creates a new Lead Status value called "Disqualified - Not a Fit" and, by habit, ticks the Converted checkbox. What problem does this cause, and how would you check which values are currently flagged as converted?
Show answer
Users will see "Disqualified - Not a Fit" in the Converted Status picklist on the Convert Lead page, so a rejected lead could be converted and create an account, contact, and possibly an opportunity. To find the flagged values, open the Lead Status Picklist Values related list in Object Manager and look at the Converted column, or run SELECT MasterLabel, IsConverted FROM LeadStatus WHERE IsConverted = true. Then clear the Converted flag on the incorrect value.
Exercise
A Salesforce Apex job calls setConvertedStatus('Closed - Converted'), but conversions fail after an administrator renames that value to "Converted - Sales Accepted". What change makes the code resilient to renames?
Show answer
Query the LeadStatus object for a value where IsConverted = true and pass its MasterLabel to setConvertedStatus, instead of hard-coding the label. If several converted values exist, filter on a stable identifier, such as a label stored in custom metadata, and update that setting when the label changes.