You need to sign in to do that
Don't have an account?
Dheeraj Chawla
can anyone explain these code lines in a simple English...?
String objType=’Account’;
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Schema.SObjectType leadSchema = schemaMap.get(objType);
Map<String, Schema.SObjectField> fieldMap = leadSchema.getDescribe().fields.getMap();
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Schema.SObjectType leadSchema = schemaMap.get(objType);
Map<String, Schema.SObjectField> fieldMap = leadSchema.getDescribe().fields.getMap();
Salesforce provides some predefined method which takes some parameter and return specific information
At the end your fieldMap will contain all the fields detail of Account object. which will include data type (text, number,checkbox, email id) data type length, isRequired, label of field etc
Makes sense?
Thanks,
Himanshu