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

SOQL Query returns 'Phantom' lead

I am performing a very simple SOQL query -

//SOSL query to send to SFDC.
string SOQLQuery = "select ID,Email,FirstName,LastName from lead where email = '" + emailAddress + "'";

// Invoke the query call and save the result in a QueryResult
qr = Binding.query(SOQLquery);

The first time the code runs, it returns no matches and I create a lead. If I convert the lead in SFDC and then run again, qr is returning a lead, even though no such lead exists that I can find. It has an ID and the data is there. I checked isConverted and it is false. I'm thinking this is a perms issue in SFDC, in that it was created with another user, but I have sysadmin perms as does the other user who would have run this code. Any ideas?
Ahh well it was isConverted... newbie mistake :-)