You need to sign in to do that
Don't have an account?
selecting accounts with owner id = current user or current user is a teammember for the account
I need to select all acounts that the current user is the owner or accounts where the current user is in the accountteammember.
This is the code that I am testing in ForceIDE
select a.id, a.ownerid, a.name from account a where a.ownerId = '0056000010dFwAAI' or a.id in (select b.accountid from accountteammember b where b.userid = '00560000001188cAAA' )
Ideally this is what I want to use:
select a.id from accounts a where a.OwnerId = \''+UserInfo.getUserId()+'\' or a.id in ( select accountID from accountteammember where userid = \''+UserInfo.getUserId()+'\'
I receive the follwing error message "Malformed Query: Semi join sub selects are not allowed with the 'or' operator.
I would appreciate any guidance.
Thank you.
Aaah buddy, you can add subquery after table name. Add it before. Or better way is use 2 quries and use SET