• Srikanth R 13
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello Folks,

Below is the sample code :
Map<Id, Lead> ledMap = //Consider this will give me 3 records
for(Lead l : leadMap.values()){
if(l.status = 'New'){
//logic here
}
else if(l.status = 'Dead'){
//logic here
}
}

What I am looking at here is, if any record meet the first creteria (l.status = 'New') then I don't want to iterate the remaining records (in this case remaining 2 records). And in case if none of the records meet the first creteria (l.status = 'New') then only I need to perform the logic inside the else if condition. 

Looking forward for your inputs.

Thanks,
Shravan