You need to sign in to do that
Don't have an account?

List Index out of bounds Error
Hello ,
Below is the code for which i am getting the error.
but i get List index out of bounds: 263 error.
can someone help me out with this.
Thanks,
Vishnu
Below is the code for which i am getting the error.
system.debug(slots.size()); for(Integer i =slots.size()-1;i>=0; i--) { system.debug(slots[i]); date d = Date.newinstance((slots[i].StartDateTime).year(),(slots[i].StartDateTime).month(),(slots[i].StartDateTime).day()); for (event__c e : event) { system.debug(e); system.debug(today2); //date d2 = Date.newinstance((e.Start_Datetime__c).year(),(e.Start_Datetime__c).month(),(e.Start_Datetime__c).day()); if(((slots[i].startDateTime<e.Start_Datetime__c && slots[i].StartDateTime.addminutes(apptmin)<e.Start_Datetime__c) || (slots[i].startDateTime>e.End_Datetime__c && slots[i].startDateTime.addminutes(apptmin)>e.End_Datetime__c)) && (e.Start_Datetime__c <=today2.addDays(6) && e.Start_DateTime__c >= today2.addDays(-1))) { } else { if(slots[i].userid == e.Event_Owner__c) { slots.remove(i); } } } }When i debug the size i get size = 264.
but i get List index out of bounds: 263 error.
can someone help me out with this.
Thanks,
Vishnu
for (i=0; i<slots.size();i++)?
It works in sandbox though.