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
mohit tripathimohit tripathi 

visualforce controller

Hi Guys, 

I am new to salesforce and it would be great if you can help me.

I am trying to initialize a list of account inside constructor but getting following error-


Error: accounttestclss Compile Error: Illegal assignment from List<Account> to List<Account> at line 7 column 6

Here is the controller=

public class accounttestclss {

public list<Account> Accont{get; set;}

    public accounttestclss(ApexPages.StandardSetController controller) {

     Accont= [select name , rating from Account limit 10];
 
    }



Thanks in advance
Best Answer chosen by mohit tripathi
Waqar Hussain SFWaqar Hussain SF
See in your classes, you must have create an apex class with name account. Delete that class or rename it and save the code again.

Let me know, If you you have any question.

All Answers

Waqar Hussain SFWaqar Hussain SF
See in your classes, you must have create an apex class with name account. Delete that class or rename it and save the code again.

Let me know, If you you have any question.
This was selected as the best answer
mohit tripathimohit tripathi
Hi Waqar,

It is working fine now.. thanks a lot for help.


:)