function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Suraj_BahaleSuraj_Bahale 

How can a developer get all of the available record types for the current user on the Case object?

A. Use SOQL to get all Cases.
B. Use DescribeSObjectResult of the Case object.
C. Use Case.getRecordTypes().
D. Use DescribeFieldResult of the Case.RecordType field.
Best Answer chosen by Suraj_Bahale
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
HI suraj,
B. Use DescribeSObjectResult of the Case object.
 
Schema.DescribeSObjectResult R = case.SObjectType.getDescribe();
List<Schema.RecordTypeInfo> RT = R.getRecordTypeInfos();

 Please refer below link
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Schema_RecordTypeInfo.htm#apex_Schema_RecordTypeInfo_methods

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards

 

All Answers

Vikas Singh SFVikas Singh SF
You can get the List<RecordTypeInfo> of all record types for Case SObject by using : Case.SObjectType.getDescribe().getRecordTypeInfos(). so you can access the Name, Id etc for record types by methods on RecordTypeInfo object.
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
HI suraj,
B. Use DescribeSObjectResult of the Case object.
 
Schema.DescribeSObjectResult R = case.SObjectType.getDescribe();
List<Schema.RecordTypeInfo> RT = R.getRecordTypeInfos();

 Please refer below link
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Schema_RecordTypeInfo.htm#apex_Schema_RecordTypeInfo_methods

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards

 
This was selected as the best answer