Last active
May 23, 2019 00:35
-
-
Save AngelOfCA/73e6b64699177da1d2b986363024d39e to your computer and use it in GitHub Desktop.
This file contains 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
trigger StockItemTrigger on Stock_Item__c (before insert, before delete) { | |
//Instantiate StockItemHandler | |
//Before Insert Handling | |
if(Trigger.isInsert && Trigger.isBefore) { | |
//call the class in your handler for before insert | |
StockItemHandler.checkDuplicateName(Trigger.new); | |
} | |
//Before Delete Handling | |
if(Trigger.isDelete && Trigger.isBefore) { | |
//call the class in your handler for before delete | |
StockItemHandler.deleteStockItems(Trigger.old); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment