Whenever some Trigger is moved to Production there might be scenarios where we need to disable the Trigger functionality.
For that we need to create a boolean field in Custom setting followed by the sample code in the Trigger
Say Custom Setting name is 'Custom Setting Name'.
Cofig Setting Name --> ConfigSetting
Field API Name --> Disable_TriggerName__c
Boolean triggerDisabled = false;
triggerDisabled = Custom_Setting_Name__c.getValues('ConfigSetting').Disable_TriggerName__c;
if (triggerDisabled == true) {
return;
}
For that we need to create a boolean field in Custom setting followed by the sample code in the Trigger
Say Custom Setting name is 'Custom Setting Name'.
Cofig Setting Name --> ConfigSetting
Field API Name --> Disable_TriggerName__c
Boolean triggerDisabled = false;
triggerDisabled = Custom_Setting_Name__c.getValues('ConfigSetting').Disable_TriggerName__c;
if (triggerDisabled == true) {
return;
}