![]() |
my sketch |
To solve the issue, we created one Global class to run SOQL just to retrieve ID, DeveloperName. It exposed our code to SOQL limit and we need to be careful with the design when we decided to use Static because the global class can be called by different method in the same transaction.
Now we can forget about that *tedious part*. I started to clean up my code to use Salesforce method instead of using SOQL to retrieve record type.
Caution : Update your class API version to the latest version to prevent error as this new method not recognized in old version.
Retrieve RecordType ID using DeveloperName
Retrieve RecordType DeveloperName using ID
Please update the underlined word above with correct value.