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
Satabdi MoharanaSatabdi Moharana 

SOQL query returns 200k records but user has access to only 10k records

I am a user who has access to 10k records in an org but my SOQL returns 200k records. What is the expected error and any workaround available to resolve this error.
ShirishaShirisha (Salesforce Developers) 
Hi Satabdi,

Greetings!

If you have read access on the Object level then you might be able to access the count but you can only see the records if the owner shared access with you.

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,
Shirisha Pathuri