+ Start a Discussion
siva@shiva.comsiva@shiva.com 

i want to dislay all objects in picklist ....

It gives an error .........like this

 

Error: DObjDisplay Compile Error: The property String objNames is referenced by Visualforce Page (getobjectsinorganization) in salesforce.com. Remove the usage and try again. at line 6 column 17

 

<apex:page sidebar="false" controller="DObjDisplay">
 <apex:form >
     ObjectNames:
     <apex:selectlist multiselect="false" size="1">
         <apex:selectOptions value="{!objNames}">
         </apex:selectOptions>
     </apex:selectlist>
 </apex:form>
</apex:page>

 

 

public with sharing class DObjDisplay {
//Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
List<SelectOption> options = new List<SelectOption>();
 

 
public List<SelectOption> getobjNames()
 {

  List<Schema.SObjectType> gdd = Schema.getGlobalDescribe().Values();    
 
  for(Schema.SObjectType f : gdd)
   {
      options.add(new SelectOption(f.getDescribe().getName(),f.getDescribe().getName()));
   }

 return options;
}

}

Best Answer chosen by Admin (Salesforce Developers) 
siva@shiva.comsiva@shiva.com

thank you ....very much

All Answers

BharathimohanBharathimohan

Hi Siva,

 

Hope this Link solves your requirement.

 

 

 

Regards,

Bharathi
Salesforce For All

Mark this post as solved, if it helps you

siva@shiva.comsiva@shiva.com

thank you ....very much

This was selected as the best answer
siva@shiva.comsiva@shiva.com

if i select one object in a picklist then the releted records will display .....is it possible