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
Andrew MneyergiAndrew Mneyergi 

Cannot Query Salesforce Object

Hello. I apologize if this is a duplicate issue, but I couldn't find a similar issue on the forums. I'm new here.

I have a custom object in Salesforce that cannot be queried. It always times out. It used to do that sometimes, but then it would work. Now, I cannot query it no matter what I do.
I tried:

  • Select Id From Object__c (Times out)
  • Select Id From Object__c Limit 5 (Times out)
  • Select Id From Other_Object__c (This works)

Any help is appreciated. Thank you.
Can you please let me know from where you are trying to execute the query.
1) Apex class
2) Salesforce Workbench
3) Developer Console
Andrew MneyergiAndrew Mneyergi
Thank you for your reply. I tried executing the queries from all 3 places.
Mudasir WaniMudasir Wani

There is nothing wrong with the query.
If you have tried with the limit as well then it may be some other issue.

Is there any SOAP or REST call in your code ?
If yes then problem is there.

Benoy VmBenoy Vm
Nothing wrong in tha tquery.
If you haven't already checked please verify whether your profile has access to that object you are trying to access.
Prosenjit Sarkar 7Prosenjit Sarkar 7
Check your profile has read permission for that object or not
Prosenjit Sarkar 7Prosenjit Sarkar 7
Also check if the deployment status of the object is 'Deployed' or 'In Development' in your product org.