Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to i count objects available in salesforce organization

Integer count = 0;
map<String, Schema.SObjectType> GlobalMap = Schema.getGlobalDescribe(); 
    for (Schema.SObjectType Obj : GlobalMap.values()) {
        Schema.DescribeSObjectResult ObjDesc = Obj.getDescribe();
        if(ObjDesc.iscustom()){
           count ++;
           system.debug('Object Name: ' + ObjDesc.getName());
        }
    }
System.debug('Custom Object '+ count );
Source by salesforce.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #count #objects #salesforce #organization
ADD COMMENT
Topic
Name
7+6 =