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
Rakesh NadipineniRakesh Nadipineni 

public class ContactExtcontroller { public List<Contact> conlist{set;get;} public ContactExtcontroller(ApexPages.StandardSetController controller) { conlist=[select id,lastname,firstname,phone,email from Contact]; } }

public class ContactExtcontroller {
public List<Contact> conlist{set;get;}

    public ContactExtcontroller(ApexPages.StandardSetController controller) {
    
conlist=[select id,lastname,firstname,phone,email from Contact];
    }

}
Here  I am getting error called"ContactExtcontroller Compile Error: Illegal assignment from List<Contact> to List<Contact> at line 6 column 1" 
Please help me anyone
Alain CabonAlain Cabon
Hello,

You have defined a class named "Contact" (rename it).

Regards
Anil MalneniAnil Malneni
APEX Class

public with sharing class ContactExtController {
    public contact c {get; set;}
    public String currentRecordId {get;set;}
    public list<contact> conlist {get; set;}
    public ContactExtController(ApexPages.StandardController controller){
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        conlist = new list<contact>();
        c = new contact();
        if(c != null){
            c = [Select Id,LastName,FirstName,Phone,Email from Contact Where Id =:currentRecordId LIMIT 1];
        }
    }
}

VF Page

<apex:page standardcontroller="Contact" extensions="ContactExtController" showHeader="false" sidebar="false" >
    <apex:slds id="sldsnew"/>
    <apex:form>
    <apex:pageBlock id="neblk" mode="edit" >
       <apex:pageBlockSection id="pbbksec1" columns="2" title="Details">
            <apex:inputField id="firstnm" value="{!c.FirstName}"/>
            <apex:inputField id="lasttnm" value="{!c.LastName}"/>
            <apex:inputField id="phnm" value="{!c.Phone}"/>
            <apex:inputField id="email" value="{!c.Email}"/>
       </apex:pageBlockSection>
        <apex:pageBlockButtons location="top">
            <apex:commandButton id="save" action="{!Save}" value="Save"/>
            <apex:commandButton id="cancel" action="{!Cancel}" value="Cancel"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>
    </apex:form>
</apex:page>


----
Comments: I have tried this in my DEV environment.. Its works for me..
try and let me know your comments...

mark this as best answer..if its works..

Thank you..