Created
March 20, 2022 23:21
-
-
Save emoran/5cc66a7b25dc9251686755998e7b85e0 to your computer and use it in GitHub Desktop.
trigger Handler basic for salesforce
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
public class SObject { | |
public static void run(){ | |
switch on Trigger.operationType { | |
when BEFORE_INSERT { | |
//Perform Before Insert logic' | |
System.debug('BEFORE INSERT FIRED');' | |
} when BEFORE_UPDATE { | |
//perform Before Update logic | |
} when BEFORE_DELETE { | |
//perform Before Delete logic | |
} when AFTER_INSERT { | |
//perform After Insert logic | |
} when AFTER_UPDATE { | |
//Perform After Update logic | |
} when AFTER_DELETE { | |
//Perform After Delete logic | |
} when AFTER_UNDELETE { | |
//Perform After UnDelete logic | |
} | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment