Is there a simple SOSL query that one can use to determine the number of objects in an org? A bonus would be to determine what type of object it is (custom, standard, packaged) etc.


This is not possible using SOSL or SOQl. But you can easily do this using Global Describe

  Map<String, Schema.SObjectType> GlobalDescribe = Schema.getGlobalDescribe();
  system.debug('----------------No Of Objects-----'+GlobalDescribe.size() );

  for(Schema.SObjectType objTyp : GlobalDescribe .Values()){
      Schema.DescribeSObjectResult ObjDesc = Obj.getDescribe();
         system.debug('--Custom Object or Custom setting---');
         system.debug('--Standard Object---');


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.