Can anyone help?
Thanks
1 个回答
Hi Svi,
I don't think so you can query directly the field label. Here is sample code that you can execute to get the field label.String type='Account';
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Schema.SObjectType leadSchema = schemaMap.get(type);
Map<String, Schema.SObjectField> fieldMap = leadSchema.getDescribe().fields.getMap();
if(fieldMap.containsKey('DHC')){
System.debug('##.Field Label Name='+fieldMap.get('DHC').getDescribe().getLabel());//It provides to get the object fields label.
}