Timeline for Fetching Record Type Name / Id values from Custom Settings - best practise
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 28, 2019 at 8:12 | comment | added | Schnaps | I think this should be marked as the correct answer. The one above is just wrong, as Ids are not reliably identical througout the systems. This one's quick, readable and clean. We use a little helper class, that you just pass the SObjectType to and it gives you a map<String, Id> mapping Labels to RecTypeId. Currently switching to using custom Labes in case the name of a Record Type changes (happens a lot unfortunately). | |
Jul 28, 2015 at 14:37 | comment | added | binaryLady | To @keithC and AlexS, if you are trying to avoid hard coded ids anywhere which will not be consistent across all orgs than you can use the record type label. You can pull all of the attributes of the record type on any object without any queries or hitting any limits (as describe limits have been removed) this way. If you still wish to use a custom setting, those labels may be stored there. Though that seems redundant as the custom setting is a key-value pair which you don't really need if you only need the label to execute the describe. | |
S Jul 28, 2015 at 12:47 | history | suggested | Alex S | CC BY-SA 3.0 |
Improved formatting
|
Jul 28, 2015 at 12:21 | review | Suggested edits | |||
S Jul 28, 2015 at 12:47 | |||||
Jul 28, 2015 at 12:16 | history | answered | binaryLady | CC BY-SA 3.0 |