You need to sign in to do that
Don't have an account?
Shane K 15
Illegal assignment from List<SObject> to List<System.Location>
I have the following code:
I am getting an error: Illegal assignment from List<SObject> to List<System.Location>
String query = ' '; query = 'SELECT Id, Name FROM Location '; List <Location> Locations = database.Query(query);
I am getting an error: Illegal assignment from List<SObject> to List<System.Location>
Please mark as Best Answer if above information was helpful.
Thanks,
I am getting the same error with your suggestion.
do you have customObject that you are trying to query or tell me what are you trying acheive?There is an example here to use Location (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_system_Location.htm#apex_class_system_Location) . let me know if it is still not resolved.
I am getting the same error message. I am trying the following:
This seems to work though: