function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MunmunMunmun 

Get the value of map

 

Hi I am getting the following  exception when I  try to run a test class.

I just remove the key based in condition from Map

 

So how to deal with this.

 

 

System.FinalException: Cannot modify a collection while it is being iterated

 

 

plz plz  reply   any one

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
cantchanandcantchanand

Hi,

 

You are using same collection on Page where you are modifying . DO one thing take the data in other collection and Modify the data and again take in same list . then use.

 

Let me know if need any help.

 

Anand Singh

 

All Answers

cantchanandcantchanand

Hi,

 

You are using same collection on Page where you are modifying . DO one thing take the data in other collection and Modify the data and again take in same list . then use.

 

Let me know if need any help.

 

Anand Singh

 

This was selected as the best answer
MunmunMunmun
Thanks Anand .
MunmunMunmun
ITS WORKING thaks alot
cantchanandcantchanand

Your Welcome

 May I know your mail Id?

MunmunMunmun