From 2711fa7f6676acce36d96319caeae4b660fdc8a2 Mon Sep 17 00:00:00 2001 From: Nils Schuch Date: Tue, 16 Aug 2022 22:40:43 +0200 Subject: [PATCH] Fix bug that ignores bypass and loop count functionality --- .../classes/CustomMDTTriggerHandler.cls | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/force-app/main/default/classes/CustomMDTTriggerHandler.cls b/force-app/main/default/classes/CustomMDTTriggerHandler.cls index 4c73f14..e14cb09 100644 --- a/force-app/main/default/classes/CustomMDTTriggerHandler.cls +++ b/force-app/main/default/classes/CustomMDTTriggerHandler.cls @@ -55,30 +55,9 @@ public with sharing class CustomMDTTriggerHandler extends TriggerHandler { continue; } - // dispatch to the correct handler method - switch on this.context { - when BEFORE_INSERT { - handler.beforeInsert(); - } - when BEFORE_UPDATE { - handler.beforeUpdate(); - } - when BEFORE_DELETE { - handler.beforeDelete(); - } - when AFTER_INSERT { - handler.afterInsert(); - } - when AFTER_UPDATE { - handler.afterUpdate(); - } - when AFTER_DELETE { - handler.afterDelete(); - } - when AFTER_UNDELETE { - handler.afterUndelete(); - } - } + // Call default handler to provide bypass and MaxLoop functionality + handler.run(); + } }