+ Start a Discussion
Rajesh SriramuluRajesh Sriramulu 

Error:Too many script statements: 200001

 

Hi

 

I Am getting this error because of for  loops , but when am trying to customize the for loops, my functionality is changing ,Please let me know there is any alternative solution for it.

 

Thanks in Advance.

sfcksfck

Hi Rajesh,

 

Can you post the code please?

 

Thanks

Rajesh SriramuluRajesh Sriramulu

Hi,

 

Thank you for ur reply, here is the code.

 

for(Id accId :map_ATypeAccountId_ATypeAccountName.keyset()){
ClassAcp cA = new ClassAcp();
cA.idAccount = accId;
cA.strStoreName = map_ATypeAccountId_ATypeAccountName.get(accId);
if(map_AccountId_NoOfVisits.containsKey(accId)){
if(!blnIsIndia)
cA.dcmNoOfVisitsPerMonth = map_AccountId_NoOfVisits.get(accId);
}
if(map_AccountId_NoOfVisits.containsKey(accId) &&
((map_AccountId_VisitCount.containsKey(accId) && Math.floor(map_AccountId_NoOfVisits.get(accId)) > map_AccountId_VisitCount.get(accId)) ||
!map_AccountId_VisitCount.containsKey(accId)))
{
if(!blnIsIndia)
cA.blnHighLightVisitsColumn = true;
}

if( map_AccountId_MaxDays.containsKey(accId) &&
(!map_AccountId_LastVisitDate.containsKey(accId) || map_AccountId_LastVisitDate.get(accId).daysBetween(Date.today()) >= map_AccountId_MaxDays.get(accId) ) )
{
if(!blnIsIndia)
cA.blnHighLightStoreInfoColumn = true;
}

if(map_AccountId_StoreInfo.containsKey(accId))
{

if(!blnIsIndia){
cA.objStoreVisit.Store_Info__c = map_AccountId_StoreInfo.get(accId).Id;
}

}

if(map_AccountId_AccountProfile.containsKey(accId)){
if(!blnIsIndia){
cA.strLegacyId = map_AccountId_AccountProfile.get(accId).Account__r.Legacy_System_Id__c;
cA.strArea = map_AccountId_AccountProfile.get(accId).Area_CBU__c;
}
}

list_tempDays = new List<Days>();
for(Integer i=0 ; i<objcur.list_Months.size();i++ ){ // objcur.list_Months.size() = 30
dd = new days();
DateTime dattim = DateTime.newInstance(objcur.list_RBDMonths[i].datdate.year(), objcur.list_RBDMonths[i].datdate.month(), objcur.list_RBDMonths[i].datdate.day());
String strdayOfWeek = dattim.format( 'EEE' );
dd.blnIsWeekend = ClassBcp.isWeekEnd(strdayOfWeek);
dd.blnisbSelected = false;
list_tempDays.add(dd);

}
cA.list_objDays = list_tempDays;
list_tempClassA.add(cA);
}

 

 

Thanks in Advance.

sfcksfck

I guess you've probably sorted it out by now but I had a look at the code anyway and it looks OK. Maybe the error is being thrown by one of the methods or constructors called by this code?