function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anne fdsgafaanne fdsgafa 

Invalid Query Scope: MineAndMyGroups

I am trying to run the query:

SELECT Id,Name FROM ListView USING SCOPE MineAndMyGroups WHERE SObjectType='Account'

I want to retrieve only listviews that are owned by the user and were shared/assigned to the user and populate them into my picklist.
When I enter that query into queryeditor I get this error:

Name FROM ListView USING SCOPE MineAndMyGroups WHERE SObjectType='Account' ^ ERROR at Row:1:Column:43 Invalid query scope: MineAndMyGroups

It works fine when I substitute "MineAndMyGroups" with "Mine". Am I missing any requirements or is there another way to achieve what I want?

Thanks
Deepali KulshresthaDeepali Kulshrestha
Hi anne,

please follow the below link:

https://help.salesforce.com/articleView?id=000232625&language=en_US&type=1
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_using_scope.htm

I hope you find the above solution helpful.If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
anne fdsgafaanne fdsgafa
Sorry that does not help me with my problem. I know what the USING SCOPE MineAndMyGroups should return but I want to know why it's telling me it's an invalid query scope.