Skip to content

Instantly share code, notes, and snippets.

@AngelOfCA
Last active May 23, 2019 00:35
Show Gist options
  • Save AngelOfCA/73e6b64699177da1d2b986363024d39e to your computer and use it in GitHub Desktop.
Save AngelOfCA/73e6b64699177da1d2b986363024d39e to your computer and use it in GitHub Desktop.
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