Skip to content

Instantly share code, notes, and snippets.

View abd3's full-sized avatar

Andrew Davis abd3

  • Copado
  • San Diego
View GitHub Profile
@abd3
abd3 / Comprehensive Trigger Template
Created July 28, 2019 19:41
"Comprehensive Trigger Template" by Mike Leach
This text and the code below, originally came from a blog post from Mike Leach. That blog has subsequently been taken offline, but the contents are shared here for reference.
From Mike Leach:
====
I decided to create a more fluent Trigger template to address the following challenges and prevent me from repeatedly making the same mistakes:
* Bulkification best practices not provisioned by the Trigger creation wizard
* Use of the 7 boolean context variables in code (isInsert, isBefore, etc...) greatly impairs readability and long-term maintainability
* Trigger.old and Trigger.new collections are not available in certain contexts
* Asynchronous trigger support not natively built-in
### Keybase proof
I hereby claim:
* I am abd3 on github.
* I am abd3721 (https://keybase.io/abd3721) on keybase.
* I have a public key ASCNtfspF3t3m_BCQ1lVjWLsJGOhZou6XC3YVmvoVB0otAo
To claim this, I am signing this object: