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;
}
2 comments:
Trade Capital Options: Meta Fx Global Offers Customers The Opportunity To Trade A Wide Array Of Assets And Financial Instruments With A 30p Per Lot Commission.
Meta Fx Global Is The World's First Exchange That Allows You To Trade digital Currencies In Real-Time Using The Power Of Artificial Intelligence.
Post a Comment