ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 350 - Certified Platform Developer II discussion

Report
Export

A business requires that every parent record must have a child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record.

A validation rule blocks child records from being created. The method uses a try/catch block to handle the DML exception.

What should the developer do to ensure the parent always has a child record?

A.
Use Database.insert () and set the allorNone parameter to true.
Answers
A.
Use Database.insert () and set the allorNone parameter to true.
B.
Use addError () on the parent record if an error occurs on the child record.
Answers
B.
Use addError () on the parent record if an error occurs on the child record.
C.
Set a database savepoint to rollback if there are errors.
Answers
C.
Set a database savepoint to rollback if there are errors.
D.
Delete the parent record in the catch statement when an error occurs on the child record DML operation.
Answers
D.
Delete the parent record in the catch statement when an error occurs on the child record DML operation.
Suggested answer: A, C
asked 23/09/2024
Abdulilah Alhousainy
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first