function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MaximeMaxime 

Trigger - Separate logic by record type

Hello,

I have multiple record types on my opportunity object (on before insert after insert etc). Some treatments are specific for my record type, some are common.

How would you create the trigger/class architecture for this ?

Thanks
AbhinavAbhinav (Salesforce Developers) 
Hi Maxime,

You can put a recordType check  by using something  similar
 
Schema.SObjectType.Account.getRecordTypeInfosByName().get('TestRecordType').getRecordTypeId();

Check below link for reference:
https://developer.salesforce.com/forums/?id=9062I000000DLGsQAO

If it helps mark it as best answer.

Thanks!