---
schema_version: "1"
id: 9cad98b214cee19172f0832f5a337071493e72c7d409653a2cd1fa0964aa660a
title: Disable Trigger Handlers for NPSP
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sfdo/264-0-0/npsp_disable_trigger_handlers_2.md
canonical_url: https://help.salesforce.com/s/articleView?id=sfdo.npsp_disable_trigger_handlers_2.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: babbd1f9a2331a2169a58e06cb18eb2bfeafca6be68a59553c8f596f707a678e
description: Learn how to disable trigger handlers for all users, specific users, and with apex code.
products:
  - Nonprofit
release: "264"
---
# Disable Trigger Handlers for NPSP

Learn how to disable trigger handlers for all users, specific users, and with apex code.

- **[Disable Trigger Handlers](https://help.salesforce.com/s/articleView?id=sfdo.npsp_disable_trigger_handlers_2.htm&release=264.0.0&type=5)**  
    Review examples of when you can disable trigger handlers.
- **[Disable Trigger Handlers for All Users](https://help.salesforce.com/s/articleView?id=sfdo.npsp_disable_trigger_handlers_2.htm&release=264.0.0&type=5)**  
    You typically disable a Trigger Handler for all users if you have a custom process or custom code that replace functionality. You may also disable a Trigger Handler for all users if you have a use case that requires that the standard behavior of an Apex class not occur for all users.
- **[Disable Trigger Handlers for Specific Users](https://help.salesforce.com/s/articleView?id=sfdo.npsp_disable_trigger_handlers_2.htm&release=264.0.0&type=5)**  
    In cases where you have a custom integration with another system, or need to perform periodic imports of data where you don't need certain Trigger Handlers to run, you can disable a Trigger Handler for specific users.
- **[Disable Trigger Handlers with Apex](https://help.salesforce.com/s/articleView?id=sfdo.npsp_disable_trigger_handlers_2.htm&release=264.0.0&type=5)**  
    Sometimes it's necessary to temporarily disable Trigger Handlers only during the execution of Apex code. NPSP offers two ways to achieve this depending on whether you want to disable specific Trigger Handlers or all Trigger Handlers at once.

## Disable Trigger Handlers

Review examples of when you can disable trigger handlers.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/images/icon_note.png)

Note If you need a refresher on the fundamentals of TDTM, read [Table-Driven Trigger Management Overview](https://help.salesforce.com/s/articleview?id=sfdo.tdtm_advanced_configuration_overview.htm).

- Temporarily disable certain Apex classes when inserting a large volume of records with data that is already structured in its final format.
- Disable Address-related Apex code when inserting or updating Contacts through a scheduled ETL job that always runs as a specific User.
- Temporarily prevent Payment or Opportunity Contact Role records from being created when Opportunities are inserted through a third-party package from the AppExchange.

It's helpful to know what each of the Apex classes do, so that you know which Trigger Handlers to disable. Visit [NPSP Codebase Documentation](https://help.salesforce.com/s/articleview?id=sfdo.npsp_apex_class_descriptions.htm) for a description of the Apex classes managed by TDTM (designated by `_TDTM` extension in the name.) Note that there are some classes that are not managed by TDTM, such as utility and settings classes.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/images/icon_important.png)

Important Be careful when changing Trigger Handler records. They're designed to work in conjunction, and changing or disabling them can lead to undesirable results. Always test in a Sandbox environment before changing Trigger Handlers in production!

## Disable Trigger Handlers for All Users

You typically disable a Trigger Handler for all users if you have a custom process or custom code that replace functionality. You may also disable a Trigger Handler for all users if you have a use case that requires that the standard behavior of an Apex class not occur for all users.

To disable a Trigger Handler:

1. Click the **Trigger Handler** tab. If you don't see it, find it in the App Launcher .
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/images/icon_note.png)
    
    Note If you still don't see the Trigger Handler tab, make sure the Tab has been properly configured. For more information, read [Prerequisites for Managing Trigger Handlers](https://help.salesforce.com/s/articleview?id=sfdo.npsp_manage_trigger_handlers.htm).
2. Click ![Down arrow icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/resources-product/images/show_more_actions_icon.png)in the row for the Trigger Handler you want to disable, and select **Edit**.
3. Deselect the **Active** checkbox.
4. For all NPSP EDA\-packaged Trigger Handlers, select the **User Managed** checkbox.
    
    ![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/images/icon_important.png)
    
    Important You must select User Managed to prevent the Trigger Handler from being reactivated during the next package update.
    
    ![Trigger Handler edit screen with Active unchecked and User Managed checked](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/resources-product/images/trigger_handler_deactivate.png)
5. Click **Save**.

To re-activate a Trigger Handler:

1. Select the **Active** checkbox.
2. Deselect **User Managed**.
3. Click **Save**.

For more information on editing Trigger Handlers, see [Edit a Trigger Handler](https://help.salesforce.com/s/articleview?id=sfdo.npsp_manage_trigger_handlers.htm) .

## Disable Trigger Handlers for Specific Users

In cases where you have a custom integration with another system, or need to perform periodic imports of data where you don't need certain Trigger Handlers to run, you can disable a Trigger Handler for specific users.

For example, let's say you have an external data source that already supplies an Account for Contacts. During the integration, you wouldn't want to run the code that creates Accounts (the ACCT\_IndividualAccounts\_TDTM class.) To stop that code from executing when the import runs, you would exclude the integration user from the Trigger Handler record for the ACCT\_IndividualAccounts\_TDTM class.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/images/icon_note.png)

Note As a best practice, dedicate a user account, called an API User, for your integrations. That way, if an actual user leaves your organization, you'll always have an active user with the correct permissions available for your integration. Read [Create a Secure Salesforce API User](https://help.salesforce.com/articleview?id=000176281&type=1) in Salesforce Help for more information.

To disable Trigger Handlers for specific users:

1. Click the **Trigger Handler** tab. If you don't see it, find it in the App Launcher.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/images/icon_note.png)
    
    Note If you still don't see the Trigger Handler tab, make sure the Tab has been properly configured. For more information, read [Prerequisites for Managing Trigger Handlers](https://help.salesforce.com/s/articleview?id=sfdo.npsp_manage_trigger_handlers.htm).
2. Click ![down arrow icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/resources-product/images/show_more_actions_icon.png)in the row for the Trigger Handler you want to disable, and select **Edit**.
3. Enter one or more usernames, separating each with a semicolon, in the **Usernames to Exclude** field. For example, integration@user.org;tester@user.org
    
    ![Trigger Handler edit page with Usernames to Exclude field populated.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/resources-product/images/tdtm-npsp-usernames-to-exclude.png)
4. Click **Save**.

## Disable Trigger Handlers with Apex

Sometimes it's necessary to temporarily disable Trigger Handlers only during the execution of Apex code. NPSP offers two ways to achieve this depending on whether you want to disable specific Trigger Handlers or all Trigger Handlers at once.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sfdo-nonprofit_success_pack-264-0-0-production-enus/bd2879e2-2bdc-4012-aa32-dc0c697c4538/images/icon_note.png)

Note This section is intended for developers and advanced admins who are familiar with Apex. The bottom line is that you can temporarily disable a Trigger Handler with code instead of editing the Trigger Handler records manually. You can't use SandboxPostCopy Interface to disable trigger handlers because the code runs before Salesforce creates the trigger handlers in the sandbox. If the options for disablement discussed earlier in this article don't address your use case, know that you can manage Trigger Handlers with code, too.

### Disable Specific Trigger Handlers

NPSP exposes a collection of Trigger Handler records through the global `TDTM_Config_API` class. As such, you can disable Trigger Handlers directly in your code and only for the execution context of the current user.

The exposed Trigger Handler collection has the following behaviors:

- Changes made to the collection persist throughout the execution context for the current user.
- Changes made to the collection do not impact other users working in the org at the same time.
- Changes made to the collection are not committed to the database by NPSP.
- Salesforce.org recommends against upserting this collection to the database after making changes.

See the [NPSP GitHub repository](https://github.com/salesforcefoundation/npsp) for more information on exposed global methods.

**Code example**:

```java
// disable trigger that creates a new Household Account for Contacts
List<npsp__Trigger_Handler__c> handlers = npsp.TDTM_Config_API.getCachedRecords();
    for (npsp__Trigger_Handler__c th : handlers) {
        if (th.npsp__Object__c == 'Contact' && th.npsp__Class__c == 'ACCT_IndividualAccounts_TDTM') {
            th.npsp__Active__c = false;
        }
    }
```

### Disable All Trigger Handlers

NPSP includes a globally exposed class called `[Callable_API](https://github.com/salesforcefoundation/npsp/blob/main/force-app/main/default/classes/callable_api.cls)` that implements the `System.Callable` interface. This interface is made available for external applications and developers to leverage NPSP APIs. You can use the `TDTM.DisableAllTriggers` action to disable all Trigger Handler records at once for a given execution context.

**Code example**:

```java
Callable npspApi = (System.Callable)Type.forName('npsp', 'Callable_API').newInstance();
Boolean isNpspTriggerDisabled = (Boolean)npspApi.call('TDTM.DisableAllTriggers', new Map<String, Object>()); 
```

These two lines turn off all Trigger Handlers, then you can continue with your own code.

### Consider Order of Execution

Consider execution order carefully in your code design. Let's say you create your own Apex trigger on the Contact object that disables all the Trigger Handlers on Contact. There is no guarantee that your trigger will run before or after TDTM does. Dealing with this scenario will vary depending on your specific use case.