Skip to content

Instantly share code, notes, and snippets.

@niavesper
Created March 21, 2021 20:56
Show Gist options
  • Save niavesper/1d498e33669147bf545dc01cc8f98a86 to your computer and use it in GitHub Desktop.
Save niavesper/1d498e33669147bf545dc01cc8f98a86 to your computer and use it in GitHub Desktop.
LeadTrigger
trigger LeadTrigger on Lead (after insert, after update) {
switch on Trigger.operationType {
when AFTER_INSERT{
LeadHandler.handleAfterInsert(trigger.new);
}
when AFTER_UPDATE{
LeadHandler.handleAfterUpdate(trigger.new, trigger.oldMap);
}
}
}
@tugce
Copy link

tugce commented Mar 24, 2021

Wow, I love the switch/case on your trigger! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment