You need to sign in to do that
Don't have an account?
Anjaan
How can i get the field names of SObject
Hello All,
I want to get field names of an SObject like Contact or Account. How can i get them. Currently i am trying to get them via
Map<String, Schema.SObjectField> m = Schema.SObjectType.Contact.fields.getMap();
I can get the string by m.getKeySet but how can i get the field names using Schema.SObjectField
Anyone help please
I want to get field names of an SObject like Contact or Account. How can i get them. Currently i am trying to get them via
Map<String, Schema.SObjectField> m = Schema.SObjectType.Contact.fields.getMap();
I can get the string by m.getKeySet but how can i get the field names using Schema.SObjectField
Code:
public List<String> getDBFields(){ Map<String, Schema.SObjectField> m = Schema.SObjectType.Contact.fields.getMap(); List<SObjectField> temp = m.values(); // Now i have to get the Label of each field }
Anyone help please
List<Schema.SObjectField> fTokens = m.values() ;
for( Integer i = 0 ; i < fTokens.size() ; i++ ){
Schema.DescribeFieldResult f = fTokens.get(i).getDescribe() ;
Message Edited by hisrinu on 01-01-2009 10:13 PM