+ Start a Discussion

how to get the API name of particular field ?


how to get the api name of particular field, and what are the methods to get the apiname, and also i need to display csv file  columes with apiname fields.



Bhawani SharmaBhawani Sharma
You can use describe method to get the API name.
Map<String, Schema.SObjectField> M = Schema.SObjectType.Account.fields.getMap();

Key is fields API Name
I guess you have to use SObject Describe.

I will suggest you to go through this link http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_describe_objects_understanding.htm