Loading tutorials
List, Set, and Map. You should have written a simple trigger on a standard object and know what insert and update do. You should also know that Salesforce enforces governor limits. Later chapters build on the vocabulary introduced her3 min readTrigger.new and Trigger.old context variables, and understand DML statements and the one-transaction model. Here you will see where triggers sit in a save, and which steps can make them run again.3 min readinsert, update), and you know that governor limits apply to each transaction. Here you will see the mechanism that makes a trigger run again inside its own transaction.3 min readbefore and after events, and understand DML statements such as update. It also assumes you know that governor limits cap what one transaction can do.2 min readTrigger.new and Trigger.oldMap, and work with List and Map collections. It builds on the earlier chapter that explained how a trigger ends up calling itself.2 min readstatic variable is, and have seen the "maximum trigger depth exceeded" error. The earlier chapters covered why a trigger that runs DML on its own object fires again. Here you will stop that with a static Boolean flag.2 min readList, Set and Map, and know that DML (insert, update, delete statements) inside an after trigger can fire that trigger again. It also assumes you know that a static variable keeps its value for the whole transaction.3 min readSet<Id> guard from the previous chapter. Here you move the guard out of the trigger and into a handler class.2 min readstatic variables last for one transaction, and you have seen a handler class that holds a recursion guard. Guards stop a trigger from re-entering itself. Sometimes you want the opposite: a deliberate second pass, or a way to switch 2 min readTrigger.new and Trigger.oldMap hold the records in the current batch, and you know that static variables last for one transaction. It compares the recursion guards from earlier chapters and gives you a way to pick one.3 min read