Salesforce Developer Soql Combine Multiple Triggers
// Salesforce - Developer - SOQL - Best Practices
// Combine triggers
It is important to avoid redundancies and inefficiencies when deploying multiple
triggers on the same object. If developed independently, it is possible to have
redundant queries that query the same dataset or possibly have redundant for
statements.
We do not have any explicit control over which trigger gets initiated first.
Each trigger that is invoked does not get its own governor limits. Instead, all
code that is processed, including the additional triggers, share those available
resources.
So instead of only the one trigger getting a maximum of 100 queries, all triggers
on that same object will share those 100 queries limit. That is why it is critical
to ensure that the multiple triggers are efficient and no redundancies exist (
combine those triggers if possible).
We may need to remove packages that we no longer need. Also, can we
purchase additional SOQL limit just like we can purchase additional API limit?
page revision: 2, last edited: 26 Mar 2017 04:38