I'm Trying to deactivate users belongs to account/contacts which related to Termination_request__c object. based on one approval process the status__c field in Termination_request__c record will update. Whenever status field updated, the Termination request trigger should fire. But not firing. What could be the problem.
Here is my trigger which should fire:
trigger TerminationRequestTrigger on Termination_Request__c (before update, after update) {
Trigger_Controls__c CS = Trigger_Controls__c.getOrgDefaults();
if(CS.Termination_Request_Trigger__c){// trigger toggle
TerminationRequestTriggerHandler handler = new TerminationRequestTriggerHandler (Trigger.isExecuting, Trigger.size);
//Runs on before update only
if(Trigger.isBefore && Trigger.isUpdate) {
system.debug('======>');
//handler.OnBeforeUpdate(trigger.new);
handler.OnBeforeUpdate(trigger.new,trigger.newMap,trigger.oldMap);
}//end of before update only
//Runs on after update only
else if(Trigger.isAfter && Trigger.isUpdate) {
handler.OnAfterUpdate(trigger.new, trigger.newMap, trigger.oldMap);
}//end of after update condition
}// end of trigger toggle
}