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
AK-2AK-2 

SOQL Count() in Force.com IDE

This is probably an easy question for some of you:

I ran the following query in the IDE "SELECT COUNT() FROM User". The query runs but I don't see the result of the query in the output window of the Force.com IDE. If I run a "SELECT name FROM User LIMIT 5", I see the 5 users in the output window.

Why do I not see the result of the first query (the one with Count)? I tried changing the query to SELECT COUNT(Id) FROM User but that only added expr0 to the output but I still don't see the number of user records.

Thank you.
Best Answer chosen by AK-2
James LoghryJames Loghry
It's probably due to the parcticular version of the Force.com IDE you're using.  I've seen it work sometimes, but not others, etc.  The SOQL editor in the IDE has become rather useless in my opnion.   Instead of the Force.com IDE, you can run the same queries in the Query Editor tab in your Developer console, or you could also usethe SOQL Query option in  https://workbench.developerforce.com/

All Answers

James LoghryJames Loghry
It's probably due to the parcticular version of the Force.com IDE you're using.  I've seen it work sometimes, but not others, etc.  The SOQL editor in the IDE has become rather useless in my opnion.   Instead of the Force.com IDE, you can run the same queries in the Query Editor tab in your Developer console, or you could also usethe SOQL Query option in  https://workbench.developerforce.com/
This was selected as the best answer
AK-2AK-2
Thanks James. Will use the Dev Console.