# Certified-Platform-Developer-II — Question 605

**Type:** multiple_choice
**Topics:** topic_1

## Question

What is a potential design issue with the following code?
trigger accountTrigger on Account (before update){ Boolean processOpportunity = false; List<opportunity> opptysClosedLost = new List<opportunity>() List<opportunity> IstAllOpp = [select StageName from Opportunity where accountId IN :Trigger.newMap.keySet()]; if(!IstAllOpp.isEmpty()) processOpportunity = true; while(processOpportunity)
{ for(opportunity o : IstAllOpp) if(o.StageName == 'Closed - Lost') opptysClosedLost.add(o); processOpportunity = false; if(!opptysClosedLost.isEmpty()) delete opptysClosedLost;

## Correct Answer

_See scenario._

---
Source: https://hiexam.net/q/salesforce/Certified-Platform-Developer-II/605  
Practice (tracked): https://hiexam.net/study/Certified-Platform-Developer-II/practice