+ Start a Discussion
Surya Teja 44Surya Teja 44 

Help : Query Metadata from apex

Hi Friends, 

So i have a requirment where i need to display all the component (objects, classes, pages, pagelayouts, workflows etc..) names, which exist in my org on a VF page.

Now this is pretty simple it was just an Page or an apex class where i can simply query the object and display the items on the VF page. The problem lies with getting info about workflows, email alerts, page layout etc. My question is how can i query the names of all these components from Apex it self? I know we can use Metadata API and all, but has anyone implemented this concept before or has a code snippet that i can look into? 

I know there are webservises involved. So could you guys please help me out here. Thanks. 
_Zach Boyd_Zach Boyd
I would recommend looking at the FinancialForceDev apex wrapper for the metadata api. It is available on GitHub at the link below.


This should provide all of the functionality you need to easily query metadata for your org directly from Apex.