All Fields label are getting in this list but i don't want ID field from below code how to avoid ID field label.
public List<String> AllLabels{get;set;}
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();
for (String fieldName: fieldMap.keySet()) {
System.debug('##Field API Name='+fieldName);// list of all field API name
AllLabels.add(fieldMap.get(fieldName).getDescribe().getLabel());
}
how to avoid ID field label
, do you want to filter out lookup fields; or get rid of Id from label such thatAccount Id
becomesAccount