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

Display custom object record
Hi All,
I have created a custom object, using a controller i need to collect a list of records belonging to a custom object and display all the records in a VF Page. Please give me some code snippet to complete this.
Thanks in advance :)
Thanks Premanath,
But i tried and got some solution..
Here is the code..
All Answers
try this code ,i am using Account object instead you can use your own object and fields names here
<apex:page controller="firstinterview">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!Data}" var="acc">
<apex:column value="{!acc.Name}"/>
<apex:column value="{!acc.BillingState}"/>
<apex:column value="{!acc.Phone}"/>
<apex:column value="{!acc.Website}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
public class firstinterview {
public firstinterview () {
}
List<Account> Varacc;
public firstinterview (ApexPages.StandardController controller) {
}
public List<Account> getData()
{
string str1=Apexpages.currentpage().getParameters().get('id');
Varacc =[Select id,Name,ShippingState,BillingState,Phone,Website from Account];
if(varacc.size()>0)
{
return Varacc;
}
return null;
}
}
if it acceptable plz make it as solution for others it may benfit
Thanks Premanath,
But i tried and got some solution..
Here is the code..