+ 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!