Menu Bar

Wednesday, 3 December 2014

Disable Trigger in Production in Salesforce

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;
    }

2 comments:

Steven Cohen said...

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.

Steven Cohen said...

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.