nerdexam
Salesforce

PDI · Question #229

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?

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)

How the community answered

(21 responses)
  • A
    95% (20)
  • C
    5% (1)

Why each option

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.

ADatabase.insert (records, false)Correct

The `Database.insert(records, false)` method allows for partial success, meaning that if some records fail to insert, the successful records will still be committed to the database without rolling back the entire transaction.

Binsert records

The shorthand `insert records` statement operates in 'all or nothing' mode by default, so if any record fails, the entire transaction is rolled back.

Cinsert (records, false)

`insert (records, false)` is not a valid Apex DML syntax for controlling partial success.

DDatabase.insert (records, true)

`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

Source: 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 Practice