Count the SOQL count() query as a single row query - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
This idea has been delivered and can no longer be voted or commented on. If you’d like to add to this conversation, please post a new idea.
7,010  Points voting closed
Delivered in Summer 18
Delivered in Summer 18

Count the SOQL count() query as a single row query

Development (Apex, LWC & VF)

It would be nice to be able to make SOQL count() calls in triggers. Right now, a count() query ... Integer value = [Select count() from Contact where ..... ]; ...can easily exceed the governor limit of 1000 in triggers, making the function useless to us. If the Apex governor were to count the call as a single query, or as some finite number of queries (e.g. 100) we could deploy code and count on it working every time.

· Flag

Latest Comment from Salesforce

  • Chris Peterson - 2 years ago

    The Apex team is taking a fresh look at any possible performance and system load impacts making this change would cause. Depending on how that goes I hope to have further updates soon.
  • Upvotes
  • Downvotes



from AppExchange


No results found.

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.