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
SkwalSkwal 

getLabel on RecordType describe

To provide localization support, I need to get the Label for recordTypes just as we can do for Objects (see sample code that works for getting the label of an object below). I tried to use the getRecordTypeInfos() method but that will not return a result that can be described. Am I missing somethingor is there no describe API on recordTypes to do that? This code is used in a visualForce component to render the label in the language locale selected by the user.

 

string objectName = 'kdsProject__c'; string plural = 'true'; Schema.DescribeSObjectResult myObject = Schema.getGlobalDescribe().get(objectName).getDescribe(); if(plural=='true') retVal = myObject.getLabelPlural(); else retVal = myObject.getLabel();