Created
March 15, 2020 23:12
-
-
Save jamesasu/f57eb7a74a207461855945dc202dd615 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global void finish(Database.BatchableContext BC){ | |
enableTriggers(); | |
} | |
global static void enableTriggers() { | |
toggleTriggers(true); | |
} | |
global static void disableTriggers() { | |
toggleTriggers(false); | |
} | |
global static void toggleTriggers(Boolean active) { | |
List<npsp__Trigger_Handler__c> handlers = npsp.TDTM_Config_API.getCachedRecords(); | |
for (npsp__Trigger_Handler__c th : handlers) { | |
if (th.npsp__Object__c == 'Allocation__c' && th.npsp__Class__c == 'ALLO_Allocations_TDTM') { | |
th.npsp__Active__c = active; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment