+ Start a Discussion

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();