You need to sign in to do that
Don't have an account?
Amar123
Apex code to get schema(Fields) of contact object.
Best Answer chosen by Amar123
Prateek Prasoon 25
String SobjectApiName = 'Contact'; Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Map<String, Schema.SObjectField> fieldMap = schemaMap.get(SobjectApiName).getDescribe().fields.getMap(); for(String fieldName : fieldMap.keyset() ) { system.debug('fieldName->>'+fieldName); // This will give you the api name of the field name. }