Customer 360 for Salesforce
- Customer 360 for Salesforce Winter 2017
- All Products
trigger <TriggerName> on <CustomObject_API_Name> (after delete, after insert, after undelete,after update, before delete, before insert, before update) { DSE.API_CustomScoutClass cs =new DSE.API_CustomScoutClass('<CustomObjectName_API_Name>'); List<<CustomObject_API_Name>> <Variable1> = Trigger.new; List<<CustomObject_API_Name>> <Variable2> = Trigger.old; if (Trigger.isAfter) { if (<Variable1> != null) <Variable1> = <Variable1>.deepClone(true, true, true); if (<Variable2> != null) <Variable2> = <Variable1>.deepClone(true, true, true); } cs.triggerSynchronize((List<SObject>) <Variable1>, (List<SObject>) <Variable2>, Trigger.isInsert, Trigger.isUpdate, Trigger.isUnDelete, Trigger.isBefore, Trigger.isAfter); }
trigger EmployeeTrigger on Employee__c (after delete, after insert, after undelete, after update, before delete, before insert, before update) { DSE.API_CustomScoutClass cs = new DSE.API_CustomScoutClass('Employee__c'); List<Employee__c> newEmployee = Trigger.new; List<Employee__c> oldEmployee = Trigger.old; if (Trigger.isAfter) { if (newEmployee != null) newEmployee = newEmployee.deepClone(true, true, true); if (oldEmployee != null) oldEmployee = oldEmployee.deepClone(true, true, true); } cs.triggerSynchronize((List<SObject>) newEmployee, (List<SObject>) oldEmployee, Trigger.isInsert, Trigger.isUpdate, Trigger.isDelete, Trigger.isUnDelete, Trigger.isBefore, Trigger.isAfter); }