You need to sign in to do that
Don't have an account?
David Matusow
whoid in select from lead results not found
I have an odd event happening. I am doing a simple SELECT in an event, but the whoId is not correct. I have a method that determines the element type (lead, account, opportunity, etc) and I see the whoid in there for the lead. I immediately do a select (below) but the select fails because the whoid shows an event instead of the lead I'm working with. I can't see why this should be.
11:17:25.0 (111774981)|EXCEPTION_THROWN|[126]|System.QueryException:
Event WHERE id = '00U15-------'
Above this, the whoid shows it to be a lead (00Q150-----).
What could I be doing wrong??
List<Lead> leadList = [select Id, Name, PostalCode, Street, State, City, Latitude, Longitude from Lead where Id = :whoId];I can run the EXACT same query and get a response. I can see the whoid and it shows the correct ID for the lead. In the code, it fails:
11:17:25.0 (111774981)|EXCEPTION_THROWN|[126]|System.QueryException:
Event WHERE id = '00U15-------'
Above this, the whoid shows it to be a lead (00Q150-----).
What could I be doing wrong??
nothing fancy! It only sends back a setting that is easier to use than having to do the above. It doesn't SET whoid!
I was thinking that maybe it's tied into the polymorphic nature, but none of the other related queries fail (account, opportunity, case, and contact (which is also using whoid)). Very perpexed!!