New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

Showing posts with label Illegal assignment from Account List to Account List. Show all posts
Showing posts with label Illegal assignment from Account List to Account List. Show all posts

Saturday, 11 August 2012

Illegal assignment from LIST to LIST

* If there is any apex class with the same name of the standard or global sObjects while creating List, map,set the above error will reflect.
*We can solve this problem in two ways:
1. We have to rename our Apex Class to some other name.
2. Use 'Schema' before sObject while creating List, Set, Map (Don't use 'schema' before sObject in SOQL Query)
- List<Schema.Account> aclist = new List<Schema.Account>();
- return type should be also like List<Schema.Account>
-Click here to see the example here!

Refer:
 Illegal assignment from LIST<Account> to LIST<Account>

Labels