You need to sign in to do that
Don't have an account?
My Code is there And i want to call employee name from custom controller but i am unable to get all the names.
<apex:pageBlock title="List Of Employee With Details">
<apex:pageBlockTable value="{!chs}" var="e" >
<apex:column value="{!e.Employee_name__c}"/>
</apex:pageBlockTable>
my controller
public with sharing class ControllerforMulti {
public EmployeeDetail__c chs{get; set;}
public ControllerforMulti(){
chs= new EmployeeDetail__c();
docs = new Task_Management__c();
}
public PageReference saveObjects() {
insert chs;
docs.Empo_Name__c = chs.Employee_name__c;
insert docs;
PageReference prs = new PageReference('/'+docs.id);
return prs;
}
}
<apex:pageBlockTable value="{!chs}" var="e" >
<apex:column value="{!e.Employee_name__c}"/>
</apex:pageBlockTable>
my controller
public with sharing class ControllerforMulti {
public EmployeeDetail__c chs{get; set;}
public ControllerforMulti(){
chs= new EmployeeDetail__c();
docs = new Task_Management__c();
}
public PageReference saveObjects() {
insert chs;
docs.Empo_Name__c = chs.Employee_name__c;
insert docs;
PageReference prs = new PageReference('/'+docs.id);
return prs;
}
}
FIrst thing your "EmployeeDetail__c " object instance is not a list.
Second thing you haven't query records then how they will display on the page.
public with sharing class ControllerforMulti {
public list<EmployeeDetail__c> chs{get; set;}
public ControllerforMulti(){
chs= [select id, Employee_name__c from EmployeeDetail__c];
docs = new Task_Management__c();
}
}
Sorry for the late response can you please paste your code here after modification done.
I think you are comparing a list with a single object instance that;s why you are getting this error.