Create a Hierarchical custom setting “Trigger Setting”. Create fields for all triggers developed in your system. This custom setting should be used to enable/disable any trigger from your org.
HI Shivani, Create a custom setting (say Trigger_Settings__c). Add a checkbox field “Is Active”. So your custom settings will store the trigger name and its status in IsActive checkbox. Then in your apex trigger, add an IF condition at the top to check if the Trigger status in Custom settings is TRUE, only then run the entire apex trigger code.
Also see https://salesforce.stackexchange.com/questions/166252/activate-and-deactivate-trigger-using-custom-setting Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.Thank you
HI Shivani, Create a custom setting (say Trigger_Settings__c). Add a checkbox field “Is Active”. So your custom settings will store the trigger name and its status in IsActive checkbox. Then in your apex trigger, add an IF condition at the top to check if the Trigger status in Custom settings is TRUE, only then run the entire apex trigger code.
Also see https://salesforce.stackexchange.com/questions/166252/activate-and-deactivate-trigger-using-custom-setting Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.Thank you
Create a custom setting (say Trigger_Settings__c). Add a checkbox field “Is Active”. So your custom settings will store the trigger name and its status in IsActive checkbox.
Then in your apex trigger, add an IF condition at the top to check if the Trigger status in Custom settings is TRUE, only then run the entire apex trigger code. So, every time you want to turn off the trigger in production, just go to your custom settings and uncheck the IsActive checkbox for that trigger
Reference:https://sfdcfanboy.com/2017/11/23/a-tip-a-day-23-5-ways-to-stop-trigger-in-production/#
Also see https://salesforce.stackexchange.com/questions/166252/activate-and-deactivate-trigger-using-custom-setting
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.Thank you
All Answers
Create a custom setting (say Trigger_Settings__c). Add a checkbox field “Is Active”. So your custom settings will store the trigger name and its status in IsActive checkbox.
Then in your apex trigger, add an IF condition at the top to check if the Trigger status in Custom settings is TRUE, only then run the entire apex trigger code. So, every time you want to turn off the trigger in production, just go to your custom settings and uncheck the IsActive checkbox for that trigger
Reference:https://sfdcfanboy.com/2017/11/23/a-tip-a-day-23-5-ways-to-stop-trigger-in-production/#
Also see https://salesforce.stackexchange.com/questions/166252/activate-and-deactivate-trigger-using-custom-setting
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.Thank you