ApexSensei

Drills Triggers

Write your first before-insert trigger

A before insert trigger sees new records in Trigger.new before Salesforce saves them.

Your task

Fill the body of the before insert trigger so every new Contact with a blank Description gets 'New contact' before it saves.

trigger AS_8AF8EF0B5878_ContactBefore on Contact (before insert) {
}

Requirements

  1. defaultsNullDescription should pass
  2. handlesBlankFirstThenFilled should pass
  3. preservesExistingDescription should pass
  4. handlesMixedContacts should pass
  5. handlesBulkOfTwoHundred should pass

Sign in to open this drill