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 

SOSL Query

how to get the list of all avilable sobjects in salesforce database ?  using soql,sosl,apex  any one .
i want to know the count of sobject in salesforce organization. and number of fields in single object . this is my requirement.
Sfd developerSfd developer



try this,


Apex Class:

public class clsObjects{
	public Map<String, Integer> 		mapObjandFields 		{get;set;}
	public List<String> getOrgObj(){
		List<String> orgObjects = new List<String>();
		for (Schema.sObjectType obj : Schema.getGlobalDescribe().keySet()){
			if (!mapObjandFields.containsKey(obj.getDescribe().getLabel())){
				mapObjandFields.put(obj.getDescribe().getLabel(), Schema.getGlobalDescribe().get(obj).getDescribe().fields.getMap().zize());
		return orgObjects;




<apex:page controller="clsObjects" >
		<apex:pageBlock >
			<apex:pageBlockTable value="{!OrgObj}" var="obj">
				<apex:column value="{!obj}" />
				<apex:column value="{!mapObjandFields[obj]}" />