Skip to Content

Welcome!

Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
27 Views

  Go to Setup → Storage Usage — it shows record counts for all standard and custom objects without any coding.  

 

If you want it through code, run this in Developer Console → Anonymous Window: 

for (SObjectType obj : Schema.getGlobalDescribe().values()) {

try {

System.debug(obj.getDescribe().getName() + ' → ' + Database.countQuery('SELECT count() FROM ' + obj.getDescribe().getName()));

} catch (Exception e) {}

}

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!