exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 263 discussion

Actual exam question from Salesforce's CRT-450
Question #: 263
Topic #: 1
[All CRT-450 Questions]

What is the result of the following code?

Account a = new Account ();
Database.insert (a, false);

  • A. The record will be created and no error will be reported.
  • B. The record will not be created and no error will be reported.
  • C. The record will be created and a message will be in the debug log.
  • D. The record will not be created and an exception will be thrown.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
smoota
1 year, 3 months ago
Why not D?
upvoted 2 times
DavidSFDev9
11 months, 2 weeks ago
When the AllorNone value is set to false, no error is returned when there's partial sucess or actually even if no records are inserted at all. Here since Account a is null, nothing can be inserted, but since that parameter is set to false, no error is reported. See: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_database.htm#apex_System_Database_insert
upvoted 2 times
irina_735
7 months, 4 weeks ago
Variable 'a' is not null, its empty Account. And in everything else you're right
upvoted 1 times
...
...
esabbatini
11 months, 3 weeks ago
Because is database.insert(value, false);
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago