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
if(Trigger.isInsert && Trigger.isBefore) { | |
//call the class in your handler for before insert | |
// StockItemHandler.onBeforeInsert(Trigger.new); | |
//We create a set to accept all the incoming records. Sets don't allow duplicates, | |
//so this is good for bulk uploads--imagine somemone uploading a CSV of 1000 pot holders. | |
//We only want the record once! | |
Set<String> stockItemSet = new Set<String>(); | |
//Starting a for loop to inspect the records coming into the trigger. | |
for(Stock_Item__c si : Trigger.new){ |
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 DateLogicOpp2 on OpportunityLineItem (before insert, before update) { | |
for (OpportunityLineItem oli :Trigger.new) { | |
if(oli.ServiceDate !=null){ | |
DateTime startDate = DateTime.newInstance | |
(oli.ServiceDate, Time.newInstance(12,0,0,0)); | |
if (oli.Materials_Due_2_Weeks__c) { | |
oli.Materials_Due_Date__c = oli.ServiceDate - (Integer.valueOf(startDate.format('u')) + 11); |
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
//Get 1 egg from fridge | |
//Get mushrooms from fridge | |
//Get carton of egg whites from fridge | |
//Get olive oil from cupboard | |
//Get 2 bowls from cupboard | |
//Get food scale from counter | |
//Get spatula from drawer | |
//Get fork from drawer | |