You need to sign in to do that
Don't have an account?

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
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
You have defined a class named "Contact" (rename it).
Regards
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..