You need to sign in to do that
Don't have an account?
Pranav_Vaidya
Custom object fields on Visual force pages
Hi,
I am new to Visual Force development and creating my first visual force page. All that I want to do is show records from a custom object on a VF page. I don't see any employee names.
Below is my code.
<apex:page standardController="Employee__c" >
<apex:pageBlock title="Employee details">
Employee email - {!Employee__c.Emp_Email__c}
</apex:pageBlock>
<apex:detail />
</apex:page>
Any help is much appreciated.
Thanks.
try this
<apex:page Controller="Employee" >
<apex:pageBlock title="Employee details">
Employee email - {!EmpEmail}
</apex:pageBlock>
<apex:detail />
</apex:page>
create a Controller (Employee)
take id from the page.
Employee__c emp = new Employee__c();
emp = [Select Emp_Email__c from Employee__c where id = :id from the page ];
public email getEmpEmail()
{
return emp.fieldname;
}
thanks
Anuraj
All Answers
try this
<apex:page Controller="Employee" >
<apex:pageBlock title="Employee details">
Employee email - {!EmpEmail}
</apex:pageBlock>
<apex:detail />
</apex:page>
create a Controller (Employee)
take id from the page.
Employee__c emp = new Employee__c();
emp = [Select Emp_Email__c from Employee__c where id = :id from the page ];
public email getEmpEmail()
{
return emp.fieldname;
}
thanks
Anuraj
Thanks Anuraj.
This might sound a bit silly but How do I create a controller? I am new to Force.com development and not aware of various terms.
Could you please suggest some pointers in starting VF page development.
Thanks.
You shouldn't need this controller, it just duplicates what is done by standard controller when you specify an id in the page's query parameters. See chamil's reply .