You need to sign in to do that
Don't have an account?
aks0011
Getting Field set Name dynamically?
Hi,
I want to get if Opportunity has an Field set of it's Fields, by knowing only that it's an opportunity record.
if any one know it than please let me know . thanks in advance ...... :)
I want to get if Opportunity has an Field set of it's Fields, by knowing only that it's an opportunity record.
if any one know it than please let me know . thanks in advance ...... :)
you can put all object in picklist when you can select any one object that willl show all field
for this you can use refer this
http://developer.force.com/cookbook/recipe/retrieve-a-list-of-objects-using-apex
http://blogs.developerforce.com/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_describe_objects_understanding.htm
if its is helpful pls like .....
You could also do SObjectTYpe.Opportunity.FieldSets.getMap().get('fieldsetname') if you want it dynamic.
From there you could do :
for(Schema.FieldSetMember f :SObjectTYpe.Opportunity.FieldSets.getMap().get('fieldsetname'))
{
System.Debug(f.getLabel() + ' - ' + f.getFieldPath());
}