function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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) {
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()];


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

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