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 );