You need to sign in to do that
Don't have an account?

how to display all sobject and their fields?
in one drop down, i want to display all object, once i will select the object from dropdown, in second dropdown it will show all the fields for selected objects.
Once try this code.
Visualforce page :
Controller :
All Answers
There is no spacific Query to list all the fiedls for all SObject. you have to use any app to schema lister to view all the field bassed on object.
You can try Schema Lister developed by one of the developers at Tquila. Navigate to URL https://schemalister.herokuapp.com/, select your environment and API version, authorise the Apps through OAuth and it will generate a list of all the objects and fields. The benefit of using this app is that you don’t need to install anything in your Salesforce org and don’t need to provide your Salesforce username and password (as the app uses OAuth to connect to Salesforce)
if you are not convinenet using above said link find some apps which is avaiable in App Exchange.
https://appexchange.salesforce.com/results?keywords=metadata
Hope this will help you,
mark Best ANSWER if its clear.
Thanks
karthik
1. Retrieve the objects from the salesforce Org.
Display all the Custom objects with “__C” names in a picklist field:
page:
=====
class:
======
2. Retrieveing all the field api names dynamically.The below samples helps to retrieve the field api names dynamically from the salesforce object.
page:
=====
class:
======
Check this blog,
http://sfdcsrini.blogspot.com/2014/11/dynamic-apex-in-salesforce.html
Once try this code.
Visualforce page :
Controller :