I'm attempting to create a list with accounts from user's territory. SYSTEMS__c is custom object, Account__c is a lookup to accounts. Here what I have gone so far...
List<AccountShare> list_AccountShare = [Select AccountId from AccountShare
where ( UserOrGroupId IN : map_group OR UserOrGroupId =:userId )
AND RowCause IN ('Territory', 'TerritoryManual', 'TerritoryRule')];
List<SYSTEMS__c> list_Partners = [SELECT Account__c,Number__c,LEGACY_CUST_NUM__c
FROM SYSTEMS__c where Account__c IN: list_AccountShare];
But I get this error..
Error: Compile Error: Invalid bind expression type of SOBJECT:AccountShare does not match domain of foreign key
I guess the IN clause syntax is incorrect. Any suggestions? Thanks.