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
bakasanbakasan 

Converted Leads

Tried to find an analagous thread by searching but couldn't find anything germaine to my question--

When a lead is converted within the Salesforce GUI, does that lead still show up inside of general SOQL queries?  The behavior on the website when you do assorted searches and what not is to not display that lead.  If you try to go to the lead by its ID in the URL directly, you get a friendly error message saying the lead is already converted.

If I did a SOQL that was effecitvely "SELECT Id FROM Lead WHERE Email = 'foo@foobar.com'", would that guy still show up or does one specifically have to denote IsConverted as part of the query?

I could have sworn that lead queries were mimicking the behavior seen on the site, but we've recently started to see this not be the case.  I'm somewhat perplexed since we'd been working against the assumption that was true, so I theoretically should have seen some of the error behavior I'm seeing now much sooner, since that assumption is baked into some of our S-Controls and other integration pieces at a fairly low level.

Is there any other special behavior of a converted lead that one ought to be aware of?  (i.e. the fields are read only post convert?)

TIA.
sfdcfoxsfdcfox
The API's SOQL behaves more like a report than a search; converted leads will appear unless you tell it not to. Be sure to tell Salesforce that you're not interested in the converted leads:

select id, name, email from lead where isconverted = false and email = 'foo@bar.com'

That way, you won't get converted leads in your results.

And yes, leads converted can not be modified in any way, shape, or form.

~ sfdcfox ~