Salesforce Apex triggers cannot be edited directly in a production org. To deactivate a trigger, you change it in a sandbox or development environment, and then deploy the change.
Method 1: Deactivate and deploy
- Open the trigger in a sandbox, using Setup, the Developer Console, or your IDE.
- Clear the Active checkbox, or set the status to Inactive in the trigger’s metadata.
- Run your tests, and confirm that nothing depends on the trigger.
- Deploy to production using a change set, the Salesforce CLI or the Metadata API.
Production deployments must meet Salesforce’s test requirements, so plan time for the deployment.
Method 2: Add a bypass switch
Many teams build a switch into their trigger framework, often using custom metadata or a custom setting. Admins can then turn trigger logic off for certain users, or temporarily, without a full deployment. This is useful for data loads, but needs to be designed and deployed in advance.
For managed packages
Triggers from installed managed packages cannot usually be edited. Check the package’s own settings, or contact the vendor.
Before deactivating
- Understand what the trigger does, such as validation, automation or integrations.
- Check for dependent processes and tests.
- Tell your team, and document the change.
- Plan to reactivate it, and test that afterward.
Salesforce’s interface changes over time, so check the current Salesforce documentation for exact steps.