Timeline for Will the trigger be fired twice in this situation?
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 5, 2014 at 12:15 | comment | added | Chris Duncombe | I would definitely use utility classes, this is just a basic demonstration and didn't want to make it too confusing. I would argue that code reuse is a fairly important practical benefit. Especially to those just learning the language. Also encouraging a single trigger per object is fairly important for those learning the language. There are situations where you go against this practice, but that is more advanced and likely doesn't need to be addressed until someone has the basics down. | |
Jun 5, 2014 at 1:06 | comment | added | sfdcfox♦ | The poster stated that one trigger handles only before-dml events, the other only after-dml events. Their order of operation is determinate in this case. Other than for code re-use, there's no practical benefit of the design you've outlined here, especially if you don't use utility classes, which may cause the trigger to reach thousands of lines of code and become very difficult to read. | |
Jun 4, 2014 at 21:50 | history | answered | Chris Duncombe | CC BY-SA 3.0 |