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
Chandu007Chandu007 

How to get all custom objects API names, Label, count of records and Last modified date

Hi,

In my org we have around 500 custom objects and they have some records(data). now my requirement is to get all those custom objects API names, record count of each object and last modified date of each record in object. to get record count of each object i am using (select count() from custom object name) 500 times. So, can i get this in a single shot into vf page or excel using query or Apex code? any suggestions? 
Best Answer chosen by Chandu007
SandhyaSandhya (Salesforce Developers) 
Hi,

You can use Schema.getGlobalDescribe() to get all properties of sobject .

Please refer below links which have sample code that may help you.

https://jungleeforce.wordpress.com/2013/06/07/extracting-list-of-all-the-objects-standard-custom-in-salesforce/


http://salesforce.stackexchange.com/questions/48920/dynamic-picklists-of-objects-its-fields/48936#48936
 
http://salesforce.stackexchange.com/questions/100668/retrieve-api-names-of-all-object-in-salesforce-org-using-soql
 
Hope this helps you!

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya

 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi,

You can use Schema.getGlobalDescribe() to get all properties of sobject .

Please refer below links which have sample code that may help you.

https://jungleeforce.wordpress.com/2013/06/07/extracting-list-of-all-the-objects-standard-custom-in-salesforce/


http://salesforce.stackexchange.com/questions/48920/dynamic-picklists-of-objects-its-fields/48936#48936
 
http://salesforce.stackexchange.com/questions/100668/retrieve-api-names-of-all-object-in-salesforce-org-using-soql
 
Hope this helps you!

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya

 
This was selected as the best answer
Sangharsh AggarwalSangharsh Aggarwal
I found an easier way to do this.
  1. Go to Setup-->Data Export
  2. Click Schedule Export
  3. Copy Paste the webpage shown there. At the bottom it lists down all Objects, standard and custom in three rows.
  4. Put it in Excel/Notepad, and cleanup to get the list.
Nicola MitchamNicola Mitcham

There is a much simpler solution from Rakesh here (extract Custom Object List):

https://automationchampion.com/2022/03/31/easiest-way-to-find-newly-created-objects-and-fields-in-salesforce/

I used:

SELECT DeveloperName, SharingModel, CreatedBy.Name, CreatedDate 

FROM CustomObject

WHERE CreatedDate= LAST_N_DAYS:365 

order by CreatedDate DESC