+ Start a Discussion
cool 183cool 183 

APEX and VF code

how to get the existing record values to the visualforce page using controller class..?? I have created an object and it has records in it. I have also created a visualforce page similar to that object detail page. I want to get those existing record values into my vf page. Plz help me how to do it.
You don't need Apex for this requirement. You just need to reference your object's standard controller in your visualforce page. E.g. if you have a custom object called "Country" then you can simply display the records in visualforce page like this:
<apex:page standardController="Country__c">

<apex:outputField value="{!Country__c.Name}"/>
<apex:outputField value="{!Country__c.Population__c}"/>

Krishna SambarajuKrishna Sambaraju
Here is an example of a VF page that displays the details of an account.
<apex:page standardController="Account">
    <apex:detail />

You also need to pass the id of the object as url parameter for the visualforce page (example: /apex/AccountDetailPage?id=0012400000AlmaI).

Hope this helps.