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
gaddam rajgaddam raj 

create a visual force page for pick list

write a vf page to dispaly all the objects as picklist

and when i select any object from picklist it should populate all the record of that particular object?

Sumitkumar_ShingaviSumitkumar_Shingavi
You can get list of all Objects in Apex using below code:
public String SelectedObject;

public List<SelectOption> getAvailableObjectList(){
	//Available objects list
	if (AvailableObjects == null) {
		AvailableObjects = new List<SelectOption>();
		for(DescribeSObjectResult obj : getMapObjectDescriptions().values()) {
			if (obj.isQueryable() && obj.isUpdateable() && obj.getKeyPrefix() != '')
				AvailableObjects.add(new SelectOption(obj.getName(), obj.getLabel() + ' (' + obj.getName() + ')'));                    
		}
	}
	
	List<SelectOption> returnFinalListObj = new List<SelectOption> (); 
	returnFinalListObj.add(new SelectOption('', '-- Select an Object --'));      
	returnFinalListObj.addAll(AvailableObjects);  
	AvailableObjects = returnFinalListObj; 
	return AvailableObjects;
}

public transient Map<String, Schema.DescribeSObjectResult> mapObjectDescriptions = null;
public Map<String, Schema.DescribeSObjectResult> getMapObjectDescriptions() {
	if (mapObjectDescriptions == null) {
		mapObjectDescriptions = new Map<String, Schema.DescribeSObjectResult>();
		
		Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
		
		for (Schema.SObjectType typ : gd.values()) {
			Schema.DescribeSObjectResult D = typ.getDescribe();
			
			mapObjectDescriptions.put(D.getName(), D);
		} 
	}
	return mapObjectDescriptions;
}
In VF: Show this list of objects as picklist like below:
<apex:selectList value="{!SelectedObject}" size="1">
	<apex:selectOptions value="{!AvailableObjectList}"/>
</apex:selectCheckboxes>

Once you get value in "SelectedObject" you can form a dynamic SOQL and do a query on required object.

Other way: you can also use <apex:actionSupport> tag inside <apex:selectList> tag on onchange event and fire a action which will refresh sObject list. You might need to use dynamic data type for list creation.

PS: if this answers your question then hit Like and mark it as solution!