ApexSensei

Drills Triggers

Mark parent Accounts in bulk

A bulk-safe trigger handler collects parent Ids first and runs one query and one update for the whole batch.

Your task

Complete afterInsert so every Account tied to a new Contact has Description = 'Has new contacts', with one query and one update.

public class AS_CD9B55EE77FD_ParentMarker {
    public static void afterInsert(List<Contact> contacts) {
    }
}

Requirements

  1. marksOneParent should pass
  2. marksEveryDistinctParent should pass
  3. leavesUnrelatedParentUntouched should pass
  4. keepsCostFlatFromTwoToTwoHundred should pass
  5. handlesBulkOfTwoHundred should pass
  6. guardsAgainstNullAccountId should pass

Sign in to open this drill