SALESFORCE-PD1 Developer Fundamentals Practice Question
A developer is writing a batch Apex class. During the execute method, a record fails validation. The developer wants to ensure that successfully processed records in the same batch are committed while failing records are logged without aborting the entire batch. How should the DML be performed?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Database.insert(records, false)
Using Database.insert(records, false) performs partial DML success, allowing valid records to commit while returning an array of save results for error handling.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
try-catch block around a standard insert statement
Why it's wrong here
Catching a DML exception rolls back the entire transaction unless Savepoints are used.
- ✗
Database.upsert(records, true)
Why it's wrong here
Passing true enforces all-or-nothing behavior, rolling back on any error.
- ✓
Database.insert(records, false)
Why this is correct
Passing false for allOrNone enables partial success processing.
- ✗
Standard insert statement (e.g., insert records;)
Why it's wrong here
Standard DML throws an unhandled exception and rolls back the entire batch chunk on failure.
About these practice questions
One of 493 original SALESFORCE-PD1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Salesforce exam blueprint
This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.