You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-4Lines changed: 61 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,13 +29,70 @@ The class and test class are found in this [folder](/force-app/main/default/clas
29
29
30
30
## [Changelog](./CHANGELOG.md)
31
31
32
-
- 2023-08-18
32
+
- 2023-09 Overload getRecordTypeFromId so it doesn't require a SobjectType string
33
+
34
+
- 2023-08
33
35
34
36
- Add methods to get default RecordTypeId, handling situation where no RT is on the Profile but at least one is avaialble via Permission Set.
35
37
- Add test methods against Account and Solution objects, as we assume Solution has no defined record types. (Change for your org if you have them.)
38
+
- Include table of all methods on documentation site
39
+
40
+
- 2022-03 BREAKING CHANGE: Replaced "DeveloperName" with "DevName" in all method names. Update your code to refer to the new methods.
41
+
42
+
- 2022-03 Add maps Id => Name and Id => DeveloperName for ease of use when wanting to refer to a record type by Id without including the object, since Id is globally unique
43
+
44
+
- 2022-01 Initial Release
45
+
46
+
## Code Header
47
+
48
+
Written by Evan Callahan, copyright (c) 2010 Groundwire
49
+
50
+
- This program is released under the [GNU General Public License](./LICENSE). http://www.gnu.org/licenses/
51
+
- This class is meant to allow for access to Record Type information from within other classes.
52
+
- It is called statically, and therefore will supply the same information to all calls made from within one transaction, or set of trigger calls. This is beneficial because this info should be the same for all calls in a transaction, and by calling it statically we reduce the calls that are made, making the total transaction more efficient.
53
+
54
+
Updated by David Schach, copyright (c) 2021 X-Squared on Demand
55
+
56
+
- Usage recommendation: Always use DeveloperName instead of Name, as this is more likely to be hard-coded in places, while the Name is actually a label and may change (especially due to user language).
57
+
58
+
# Library Methods
59
+
60
+
(Full documentation at [https://dschach.github.io/record-types](https://dschach.github.io/record-types/))
61
+
62
+
## Most Common Methods
63
+
64
+
These are the most common methods to be used. They are the fastest ways to get a Record Type Id from an object name and the developer name, for example.
65
+
66
+
There are some overloaded methods included for historical purposes (the ones that accept a Record Type Id and an object name and return the developer name).
67
+
While the object name is, technically, optional, that method is faster because it does not require memoizing a SOQL query.
68
+
69
+
| Parameters / Output | Id | Name | DeveloperName |
- 2022-03-29 BREAKING CHANGE: Replaced "DeveloperName" with "DevName" in all method names. Update your code to refer to the new methods.
83
+
These methods are used less often but may be useful.
38
84
39
-
- 2022-03-29 Add maps Id => Name and Id => DeveloperName for ease of use when wanting to refer to a record type by Id without including the object, since Id is globally unique
85
+
The most useful of these are the SelectList generators for Visualforce. However, if you are using LWC, you may prefer to use some of the other methods and to parse the returned list of RecordTypeInfo items yourself.
0 commit comments