SalesforceTrailhead
  • Today
© 2026 Salesforce, Inc. All rights reserved. Privacy Terms of Use Trust Accessibility Cookie Preferences
Apex Basics & Database

Manipulate Records with DML

+500 Points~40 minsHands-On Challenge
Apex Basics & DatabaseManipulate Records with DML

Org:Mindful Goat Playground

Topics

  • Concepts
  • Hands-On Challenge

Looking for help?

Explore Help ResourcesShare Your Feedback
Learning Objectives

After completing this unit, you'll be able to:

  • Use DML to insert, update, and delete records.
  • Handle DML exceptions.

Concepts

Data Manipulation Language (DML) statements save changes to the database: insert, update, upsert, delete, undelete, and merge. Run DML on lists to stay within governor limits.

Hands-On Challenge

  1. Create a class AccountHandler with a static method insertNewAccount that takes a name.
  2. Insert an account with that name and return it.
  3. Catch DmlException and return null when the insert fails.
Check ChallengeDemo check
Previous UnitUse sObjectsNext Unit Write SOQL Queries