Get picklist values
public void getPicklistValues(){
Schema.DescribeFieldResult fieldResult = Contact.Level__c.getDescribe();
List ple = fieldResult.getPicklistValues();
for( Schema.PicklistEntry pv : ple){
System.debug(pv.getLabel() +'::'+ pv.getValue());
}
}
Dynamic Query on all fields
public void getAllFields(Id LeadId){
List fieldNames = new List();
fieldNames.addAll(Schema.getGlobalDescribe().get('Lead').getDescribe().fields.getMap().KeySet());
String queryStr = 'SELECT ';
queryStr += String.Join(fieldNames, ',');
queryStr += ' FROM Lead';
queryStr += ' WHERE id =: LeadId LIMIT 1';
Lead LdObj = Database.query(queryStr);
}