function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Naresh j 9Naresh j 9 

How to display all metadata components through visual force page?

Hello Friends,
 
My requirement is that, i need to display org metadata components (like objecta,apex classes, vf pages, record types, profiles, permisstion sets ...etc) on my VF page.

here i know i am able to petch objects metadata through Schema , but how to petch remaing metadata componets?Can you please let me know where i am going petch metadata and display my vf page.

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

Any help/guidance would be highly appreciated!!
 
Many Thanks,
Naresh j
sravan velamasravan velama
Hi Naresh,

FYI,
http://sfdcsrini.blogspot.com/2014/11/dynamic-apex-in-salesforce.html
 
Shruti khodaboleShruti khodabole
Hi Naresh,
Retrieve the objects from the salesforce Org.
Display all the Custom objects with “__C”  names in a picklist field:

page:
=====
<apex:page controller="ObjectRetrieve">
<apex:form >
<apex:outputlabel value="All Objects"/>&nbsp;&nbsp;
<apex:selectList size="1">
<apex:selectoptions value="{!objnames}"></apex:selectoptions>
</apex:selectList>
</apex:form>
</apex:page>

class:
======
public with sharing class ObjectRetrieve {

//Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();

public List<SelectOption> getobjNames()
{
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('--None','--None--'));
for(Schema.SObjectType f : gd)
{
if(f.getDescribe().getName().contains('__c'))
options.add(new SelectOption(f.getDescribe().getName(),f.getDescribe().getName()));
}
return options;
}
}

Refer below link:
http://sfdcsrini.blogspot.com/2014/11/dynamic-apex-in-salesforce.html

Thanks,
Shruti Khodabole
Salesforce Developer
http://www.zen4orce.com