Recipes by Category
App Distribution (2)
Bundle logic, interface and services for distribution.
App Logic (37)
The Apex programming language, workflow and formulas for logic.
Collaboration (6)
The Salesforce Chatter collaboration platform.
Database (29)
Data persistence, reporting and analytics.
Integration (33)
Web Service APIs and toolkits for integration.
Security (9)
Platform, application and data security.
Tools (4)
Force.com tooling
User Interface (36)
Visualforce MVC and metadata-drive user interfaces.
Web Sites (12)
Public web sites and apps with optional user registration and login.
Cookbook Home » Retrieve a List of Objects using Apex
Share
X
Vote to Verify a Recipe
Verifying a recipe is a way to give feedback to others and broaden your own understanding of the capabilities on Force.com. When you verify a recipe, please make sure the code runs, and the functionality solves the articulated problem as expected.
Please make sure:- All the necessary pieces are mentioned
- You have tested the recipe in practice
- Have sent any suggestions for improvements to the author
Please Log in to verify a recipe

Recipe Activity - Please Log in to write a comment
Also if you want to remove the system object from this list you can use this code:
http://forceguru.blogspot.in/2012/07/please-remove-system-objects-from-my.html
Use the following code to show only the filtered objects
if(filter ==null){
Hi Osama,
Thanks for the above code.
Can u pls tell me the code for finding only the list of custom objects that we created.
Good work..!!
HI,
Thanxs for the code this is what i am looking for...
will you please give me the code of getting the fields of the selected object as i am not able to get them.
thanxs in advance
by divyanshu
Hi,
The same code would run for all the asked scenarios. All you need to do is reRendering Fields picklist on the change in the Parent picklist.
Osama
Hi Osama,
The code that you have given work fine. However I want to display a list of all objects to the user on my VF page and based on the object that he selects, I would display the fields accordingly for that object. Could you please help me with this problem.
Thanks in advance !!
Hi,
I think the same code metioned above should work for you. It gives you all the objects in the org. You can use the getName() method to get the API names of the objects. Could you please explain your scenario i detail if this does not provide a solution to your problem.
We'd like to create a page (similar to the "All Tabs" page) that displays all of our Salesforce.com objects, whether they've been assigned to a tab or not (both custom and standard objects). I thought perhaps your code would lead me down this path but I didn't find much success. Any idea how much effort it would take to modify this code to create such an object list?