You need to sign in to do that
Don't have an account?
Naresh 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
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
FYI,
http://sfdcsrini.blogspot.com/2014/11/dynamic-apex-in-salesforce.html
page:
=====
<apex:page controller="ObjectRetrieve">
<apex:form >
<apex:outputlabel value="All Objects"/>
<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