I want a before update trigger to remember which of the objects need something done in the after trigger handler. I tried this but I get a null reference:
public class OpportunityTriggerHandler {
...
private Set<Id> idsToRecompute;
public void OnBeforeUpdate(Opportunity[] oldEntries, Opportunity[] updatedEntries, Map<ID, Opportunity> oldMap) {
idsToRecompute = new Set<Id>(); // this will be used in AfterUpdate
// based on data, set recomputeIds to a subset of the op ids
...
public void OnAfterUpdate(Opportunity[] oldItems, Opportunity[] newItems, Map<ID, Opportunity> oldMap) {
... D'oh! idsToRecompute is null now!
Can anyone suggest a way to implement this strategy?