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

List of all field labels and names for all objects
Is there an easy way to pull just a list of all the fields that your currently have in Salesforce for custom and standard objects? I would need the field labels and the field names.
I'm not interested in pulling all the data, just the fields.
Thanks!
Take a look at describeSObjects().
Hope that helps,
Sati
hey...,
hope this help you
Map<String, Schema.SObjectField> mapFields = Schema.getGlobalDescribe().get(selectedValue).getDescribe().fields.getMap();
List<String> sortedKeyset = new List<String>();
for (String fieldName: mapFields.keyset()){
sortedKeyset.add(fieldName);
}
Regards
Abhi
thanks man, this is great help.
integer countCustomObjects =0;
integer countCustomSettings =0;
for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){
if(objTyp.getDescribe().isCustom()){
if(objTyp.getDescribe().isCustomSetting()){
//custom setting
countCustomSettings++;
system.debug('Number '+countCustomSettings +' and Name is: '+objTyp.getDescribe().getLabel());
}else{
//custom object
countCustomObjects++;
system.debug('Number '+countCustomObjects +' and Name is: '+objTyp.getDescribe().getLabel());
}
}
}
system.debug('Total number of Custom objects is '+countCustomObjects);
system.debug('Total number of Custom Settings is '+countCustomSettings);
I'm using it to add language labels for our managed packages