I am looking for a way to get the 15 character entity ID for a custom field on my Lead object in an Apex controller. I have tried this:
private String getEntityIdFor(String fieldName) {
Map<String, Schema.SObjectField> fieldMap = Schema.SObjectType.Lead.fields.getMap();
return fieldMap.get(fieldName).getDescribe().getId();
}
Of course, there is no getId() method, but this is the closest I got.
Thanks for any help.