Notes
public class RecordTypeUtility {
public static List<RecordType> getRecordTypesbyObjectName(String ObjectName){
return [SELECT Id, Name, SObjectType FROM RecordType WHERE SObjectType =:ObjectName];
}
public static List<RecordType> getActiveRecordTypes(){
return [SELECT Id, Name, SObjectType FROM RecordType WHERE IsActive = True];
}
public static RecordType getRecordTypebyDeveloperName(String DeveloperName){
return [SELECT Id, Name, SObjectType, DeveloperName FROM RecordType WHERE DeveloperName =: DeveloperName LIMIT 1];
}
public static String getActiveRecordTypeNameByObjectName(String ObjectName){
return [SELECT Id, Name, SObjectType, DeveloperName FROM RecordType WHERE SObjectType =: ObjectName AND IsActive = True LIMIT 1].Name;
}
}
Video
Video does not exists.