What happens after the code block executes? A developer has the - ProProfs Discuss
Topics
Products
Follow Us:

What happens after the code block executes?
A developer has the following trigger that fires after insert and creates a child Case whenever a new Case is created. List childCases = new List();for (Case parent : Trigger.new){Case child = new Case(ParentId = parent.ID, Subject = parent.Subject);childCases.add(child);}insert childCases;  



A. Multiple child cases are created for each parent case in Trigger.new.
B. Child case is created for each parent case in Trigger.new.
C. The trigger enters an infinite loop and eventually fails.\r\n
D. The trigger fails if the Subject field on the parent is blank.

This question is part of Salesforce Platform Developer 1
Asked by Wyatt Williams, Last updated: Apr 04, 2020

+ Answer
Request

4 Answers

GuptaSakshi

GuptaSakshi

Answered May 27, 2017

Answer isC. The trigger enters an infinite loop and eventually fails.Please try to execute it and u will find that this is the right answer.
In future also remember, many people depend on the answer u type here, please confirm it before u type it here.
PS: no offense meant.
1
 1

victorkuldeep

IT Professional

Victorkuldeep

Replied on Nov 04, 2017

Absolutely Correct. Option C is Correct.

Varun Konda

Varun Konda

Answered May 07, 2019

To Avoid infinite loop, you have to check parent.id == null so a child case won't create another child case

 

John Adney

John Adney

Answered Aug 08, 2017

C. The trigger enters an infinite loop and eventually fails.

 

John Smith

John Smith

Answered Mar 29, 2017

Child case is created for each parent case in Trigger.new.

####
 2

John Adney

John Adney

Replied on Jul 30, 2017

Chutiya hai john...

John Adney

John Adney

Replied on Nov 16, 2017

Ans is c, i have executed it.

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.