function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
map<string, Map<String, Schema.SObjectField>> objectFieldsMap = new map<string, Map<String, Schema.SObjectField>>(); //Object field schema map
Map<String, Schema.SObjectField> objectFields
= Schema.getGlobalDescribe().get(objName).getDescribe().fields.getMap();
for(Schema.SObjectField fld :objectFields.values()){
schema.describeFieldResult dfield = fld.getDescribe();
string fldType = string.valueOf(dfield.getType());
if (fldType == 'REFERENCE'){ // Lookup field!
system.debug(string.valueOf(dfield.Name) + ' = ' + fldType);
}
}