ApexSensei

Drills Triggers

Move Opportunity logic to a handler

A trigger should pick the event; a handler class should do the work.

Your task

Move the busy trigger's logic into beforeInsert and beforeUpdate on the handler. The provided trigger already routes to them.

public class AS_18655177781B_OpportunityHandler {
    public static void beforeInsert(List<Opportunity> records) {
    }

    public static void beforeUpdate(List<Opportunity> records, Map<Id, Opportunity> oldMap) {
    }
}

Requirements

  1. labelsBlankOnInsert should pass
  2. usesEachRecordStage should pass
  3. relabelsOnStageChange should pass
  4. keepsDescriptionWhenStageSame should pass
  5. handlesBulkOfTwoHundred should pass

Sign in to open this drill