I am trying to get the api name of a record type on a object But I am only able to get Name. How can I achieve it?


This also it don't contain api name it only contain the name of the record type.


2 Answers 2


Record Types have Names (Called Record Type Label in UI) that we see in the interface and "Developer Names" (called Record Type Name in UI) that are the equivalent of API Names because they use the sluggified with underscores although not with a trailing double-underscore plus "c".

Check out this doc that explains all the metadata available about Record Type: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_recordtype.htm


According to this discussion on the Salesforce Developer forums, Record Types don't have API names. If that's the case, it would explain why the RecordTypeInfo class has a getName() method but no method to retrieve an API name.

  • yes @rob, but every record type have a name other than label by using which we refer it - Record Type Name:Project_Details. But when i check in debug log the record type name in Schema.SObjectType is Project Details i.e label for record type. My logs : [getName=Project Details;getRecordTypeId=---;isAvailable=true;isDefaultRecordTypeMapping=true;]. So how can i get the name not the label.
    – Anu
    Sep 18, 2015 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .