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
Hi,
I have 10 custom objects.
I would like to retrieve all my custom objects into a picklist using Apex code...
Please suggest me.
Thanks & Regards:
hi,
if you want to fetch all the Object into the picklist. here code is given
//**********Page**********// <apex:pageblocksection > <apex:selectList value="{!selectedObject}" size="1" id="selobj" > <apex:selectOptions value="{!objectNames}"/> </apex:selectList> </apex:pageblocksection> //*********** controller********// public class AllObjectFetch{ private Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); public List <SelectOption> objectNames {get;set;} public String selectedObject {get; set;} public AllObjectFetch() { objectNames = initObjNames(); } private List<SelectOption> initObjNames(){ List<SelectOption> objNames = new List<SelectOption>(); List<String> AllFields = new List<String>(schemaMap.keySet()); AllFields.sort(); for(String name : AllFields) objNames.add(new SelectOption(name,name)); return objNames; } }
hi,
if you want to fetch all the Object into the picklist. here code is given