All Ideas

Idea Details

Post an Idea
This idea has been delivered and can no longer be voted or commented on. If you’d like to add to this conversation, please post a new idea.
4,990  Points voting closed
Delivered in Summer 18
Delivered in Summer 18

Get RecordTypeInfos by API name method

Apex

Working in multi-language environments, we sometimes have to face problems with the translated values for RecordTypes.
We had the following case:
  1. Created a trigger for case of Recordtype "Reklamation" (=Complaint), which used Id ReklamationID = Schema.Sobjecttype.Case.getRecordTypeInfosByName().get('Reklamation').id
  2. Translated everything to english, including the RecordType names (which will be shown to the users as type of case formula field)
  3. Switched the language to english to test the translation
  4. Over night 200 Cases weren't processed, as getRecordTypeInfosByName().get'Reklamation') didn't get a result.
I think a method fetching the ID from the API name instead of the "name" (or should I say "label"?!) is necessary, if you don't want to hard code the ID in your code.
 

· Flag

Latest Comment from Salesforce

  • Chris Peterson - 1 year ago

    We're actively working on bringing this feature to Apex. Stay tuned for updates soon.
  • Upvotes
  • Downvotes

Ideas

Apps

from AppExchange

Questions

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



 

 

Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


 

Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.