You need to sign in to do that
Don't have an account?
letternumber
soql semi join trouble
I am trying to select records owned by a certain user but am getting an error:
Cannot use a polymorphic key for outer field for semi join
here is my query:
SELECT Name, Id, OwnerId
FROM lead
WHERE OwnerId in (SELECT id FROM user WHERE Username like 'xxx@xxx.com')
SOQL syntax is different from SQL. In your case you need to use the following statement:
Select Id, Name, OwnerId from Lead where Owner.UserName like 'xxx@xxx.com'
Check out this link: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_relationships.htm