nerdexam
SalesforceSalesforce

PDI · Question #229

PDI Question #229: Real Exam Question with Answer & Explanation

The correct answer is A: Database.insert (records, false). The question seeks the DML statement that allows some records in a list to be inserted successfully even if others fail, known as partial success.

Submitted by fernanda_arg· Apr 18, 2026Logic and Process Automation

Question

Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?

Options

  • ADatabase.insert (records, false)
  • Binsert records
  • Cinsert (records, false)
  • DDatabase.insert (records, true)

Explanation

The question seeks the DML statement that allows some records in a list to be inserted successfully even if others fail, known as partial success.

Common mistakes.

  • B. The shorthand insert records statement operates in 'all or nothing' mode by default, so if any record fails, the entire transaction is rolled back.
  • C. insert (records, false) is not a valid Apex DML syntax for controlling partial success.
  • D. Database.insert(records, true) explicitly enforces 'all or nothing' behavior, meaning the entire transaction will roll back if any record fails.

Concept tested. Partial success DML operations

Reference. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database.htm#apex_System_Database_insert_2

Topics

#Apex DML#Database Methods#Partial Success#Error Handling

Community Discussion

No community discussion yet for this question.

Full PDI PracticeBrowse All PDI Questions