function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
i want to see all objects name of my org into single picklist using visualforce page. how is it possible?
Hi,
Try the below code snippet as reference:
..............................
Page
<apex:page controller="objectLists" >
<apex:form >
<apex:SelectList value="{!val}" size="1">
<apex:selectOptions value="{!Name}"></apex:selectOptions>
</apex:SelectList>
</apex:form>
</apex:page>
Controller
public class objectLists{
public String val {get;set;}
public List<SelectOption> getName()
{
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
List<SelectOption> options = new List<SelectOption>();
for(Schema.SObjectType f : gd)
options.add(new SelectOption(f.getDescribe().getLabel(),f.getDescribe().getLabel()));
}
return options;
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
hi tankhs for reply, but i need to display only custom objects
Hi,
Try the below code snippet as reference:
..............................
Page
..............................
<apex:page controller="objectLists" >
<apex:form >
<apex:SelectList value="{!val}" size="1">
<apex:selectOptions value="{!Name}"></apex:selectOptions>
</apex:SelectList>
</apex:form>
</apex:page>
..............................
Controller
..............................
public class objectLists{
public String val {get;set;}
public List<SelectOption> getName()
{
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
List<SelectOption> options = new List<SelectOption>();
for(Schema.SObjectType f : gd)
{
options.add(new SelectOption(f.getDescribe().getLabel(),f.getDescribe().getLabel()));
}
return options;
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
All Answers
Hi,
Try the below code snippet as reference:
..............................
Page
..............................
<apex:page controller="objectLists" >
<apex:form >
<apex:SelectList value="{!val}" size="1">
<apex:selectOptions value="{!Name}"></apex:selectOptions>
</apex:SelectList>
</apex:form>
</apex:page>
..............................
Controller
..............................
public class objectLists{
public String val {get;set;}
public List<SelectOption> getName()
{
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
List<SelectOption> options = new List<SelectOption>();
for(Schema.SObjectType f : gd)
{
options.add(new SelectOption(f.getDescribe().getLabel(),f.getDescribe().getLabel()));
}
return options;
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
hi tankhs for reply, but i need to display only custom objects