I'd like to find out a way to query only Account records owned by a Partner user.
If I try this SOQL query, I get an error:
List<Account> allPartnerAccounts = [Select Id From Account WHERE Owner.AccountId != null];
No such column 'AccountId' on entity 'Name'.
Is there a query parameter that can do this? Note that:
- I don't want to first collect all account owners and then do a separate query to find out if they're partners.
- I'd also like to avoid nested queries, as the numbers will be huge and I will likely run into governor limits
- I know SOQL polymorphism might resolve this, but it's only available in developer preview and I need a solution urgently