You need to sign in to do that
Don't have an account?

Dynamically list all methods from DescribeSObjectResult
I would like to create a drop-down list of all the methods returned from a DescribeSObjectResult (e.g., "getLabel", "getName", "getKeyPrefix", etc.). I have been able to create a list of fields (using DescribeFieldResult) as well as child relationships, record type info, etc., but not a list of just the methods.
How can I accomplish this?
Thanks,
Barb R.
Hi,
this is currently not possible.
What you are trying to do falls under the reflection capabilities of a language. Apex does not currently allow this.
On one hand, the methods that you want to list for sObject are standard and can be found here, allowing you to hardcode them in the drop-down list:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject_describe.htm .
On the other hand, if you are interested in for Apex Reflection support you might want to vote for this idea:
http://success.salesforce.com/ideaView?c=09a30000000D9xtAAC&id=08730000000BrVaAAK .
All Answers
Hi,
this is currently not possible.
What you are trying to do falls under the reflection capabilities of a language. Apex does not currently allow this.
On one hand, the methods that you want to list for sObject are standard and can be found here, allowing you to hardcode them in the drop-down list:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject_describe.htm .
On the other hand, if you are interested in for Apex Reflection support you might want to vote for this idea:
http://success.salesforce.com/ideaView?c=09a30000000D9xtAAC&id=08730000000BrVaAAK .
Thanks....I was hoping NOT to hard-code --- I will vote for Apex reflection support.