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

Illegal assignment from List to List - No Class of same name issue
At this point I'm spinning my wheels and need to call on the experts. I am pulling a list of Strings from SOQL and trying to put them in a String List, but not matter what method I use I always seem to end up with "Illegal assignment from List to List." Once the list is populated, I want to use it and loop through each value and query a table for records that have the value. Basically a series of events occur for each value in the string list. All of the posts on line seem to be saying I have a class of the same name (nope) or I'm using a field when I need a list or something. None of that seems accurate. So why else would I be getting this error? I've tried a lot of different methods to do the list and they all work up to a point, but then I try to use the values and I hit a wall and that error pops up. Help!
In an nutshell (not actual code)
List<String> test = [Query from System]
for(Integer i=0; i< test.size(); i++){
for (List<Case> cas : [Query from System where field = test[i]]{
for(Case c: cas){
str += c.CaseNumber + ',' + c.CustomField__c;
}
//do something with str
}
}
In an nutshell (not actual code)
List<String> test = [Query from System]
for(Integer i=0; i< test.size(); i++){
for (List<Case> cas : [Query from System where field = test[i]]{
for(Case c: cas){
str += c.CaseNumber + ',' + c.CustomField__c;
}
//do something with str
}
}
All Answers