List of questions
Related questions
Question 350 - Certified Platform Developer II discussion
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.
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.
D.
Delete the parent record in the catch statement when an error occurs on the child record DML operation.
Your answer:
0 comments
Sorted by
Leave a comment first