ApexSensei

Drills Triggers

Create follow-up Tasks after Contact insert

Use after insert when related records need the new records' Ids.

Your task

In AS_B9B475322DF3_ContactTasks.afterInsert, create one Task per new Contact and insert the whole list once.

public class AS_B9B475322DF3_ContactTasks {
    public static void afterInsert(List<Contact> contacts) {
        List<Task> followUps = new List<Task>();

        for (Contact contact : contacts) {
        }

        if (!followUps.isEmpty()) {
        }
    }
}

Requirements

  1. createsOneFollowUp should pass
  2. linksTaskToSavedContact should pass
  3. buildsSubjectFromEachContact should pass
  4. setsHighPriority should pass
  5. keepsDmlFlatFromTwoToTwoHundred should pass

Sign in to open this drill