diff --git a/force-app/main/accessControl/classes/HOT_ServiceAppointmentAccessHandler.cls b/force-app/main/accessControl/classes/HOT_ServiceAppointmentAccessHandler.cls index 82baaa15f..5219bf10f 100644 --- a/force-app/main/accessControl/classes/HOT_ServiceAppointmentAccessHandler.cls +++ b/force-app/main/accessControl/classes/HOT_ServiceAppointmentAccessHandler.cls @@ -4,7 +4,7 @@ public without sharing class HOT_ServiceAppointmentAccessHandler extends MyTrigg for (ServiceAppointment sa : (List) records) { ServiceAppointment oldRecord = (ServiceAppointment) triggerOldMap.get(sa.Id); - if (sa.Status != oldRecord.Status && sa.Status == 'Dispatched') { + if (sa.Status != oldRecord.Status && sa.Status == 'Dispatched' && !system.isBatch()) { serviceAppointmentsWithUpdatedStatusDispatched.add(sa.Id); } }