Table Driven Trigger Management Framework
Author
June 29, 2021
Trigger frameworks – not something we’d look to change too often but traditional trigger frameworks don’t play well with modern development practices in Salesforce.
Why? Under older frameworks, trigger and handler classes typically initialize classes or call methods explicitly, meaning these central components are technically dependent on the logic they call.
Table-Driven Trigger Management (TDTM) is a tool you can use to manage the apex triggers. Salesforce introduced this concept out of the box for Nonprofit Starter Pack (NPSP) and Education Data Architecture (EDA). TDTM is new to most Salesforce users, which is why you haven’t heard much about it.
As EDA and NPSP rely heavily on triggers. When you have multiple triggers in the same Salesforce object, the order of trigger execution is non-deterministic.
TDTM helps you manage these apex triggers (behind-the-scenes automation). The benefits of TDTM are many. Eventually, it may introduce a risk of possible data issues due to a lack of control over triggers and their execution order. When disabling existing trigger functionalities, traditional triggers need developers to comment APEX code. Therefore, it could be difficult to maintain traditional Salesforce triggers in an Org. Developers might have a challenge in understanding and debugging problems. These concerns have been resolved with Salesforce TDTM.
That’s where TDTM comes in! TDTM grants you to easily rearrange the order of things via a table in the Salesforce interface. With TDTM you can tell your Apex trigger: do A first, then B, then C. All without code!
The Trigger Handler is then charged with the task of calling these classes when appropriate, which gives the added advantage of allowing us to centralize error handling for triggers around the Trigger Handler.
That leaves us with the following fields in our custom object Trigger_Handler__c:
- Class__c: the handler class to run
- Object__c: the object that, when being modified, will perform the class run
- Trigger_Action__c: the actions on which the class will execute (before insert, after the update, and so on)
- Load_Order__c: the order of execution in which classes for the same object, and with the same actions, will run
- Asynchronous__c: a flag that defines whether the class will run synchronously or asynchronously
TDTM only works when you already integrated this pattern into your Apex code.
Recent Posts
-
Mirketa Unveils Next-Gen AI Solutions to Redefine the Future of Work Across Industries29 Jul 2025 Press Release
-
Salesforce Implementation School Universities Higher Education23 Jul 2025 Blog
-
Salesforce Health Cloud Implementation Partner: A Complete Guide23 Jul 2025 Blog
-
XML Parsing: Using MINIDOM Vs Element Tree (etree) in Python02 Jul 2025 Blog
-
A step by step Guide to create Salesforce web-to-lead form30 Jun 2025 Blog
-
How AI is Transforming User Experience Design in 202526 Jun 2025 Blog
You Have Questions,
We Have Answers
Talk to our experts today and explore how we can help you build a connected and efficient digital ecosystem.