+ Start a Discussion
admin sureshadmin suresh 

Error: Compile Error: Illegal assignment from LIST<Account> to LIST<account> at line 2 column 4

trigger dup on Account (before insert) {
   list<account> alist=trigger.new;
}
PratikPratik (Salesforce Developers) 
Hi Suresh,

It's saving without any error.

User-added image


You can try trigger.newmap.keyset() 
smaple code:

list<account> acclist=[select id, name, type from account where id in: trigger.newmap.keyset()];

Thanks,
Pratik

P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.


 
lakslaks
Hi Suresh,

Chances are that you have an Apex class named Account in your org. Rename it and try saving.
Or you can also use - list<Schema.account> alist

Regards,
Lakshmi.