You need to sign in to do that
Don't have an account?
AmbigaRam
How to display the list of records with link?
Hi,
I want to show the list of records with the link using VF page.
When I click any one of the link of the record from list, It has to show the details of the record.
Can anyone help for this?
Thanks and Regards.,
R.Ambiga
Hi,
you can create a controller which query the records from any object and display that list into the VF with apex:pageBlockTable etc.
Controller :
public Class AccountController {
public List<Account> getAccList() {
return [select id,name,Type from Account]; // return the list of accounts.
}
}
VF :
<apex:page controller="AccountController">
<apex:form>
<apex:pageBlock title="Account Records">
<apex:pageBlockTable value="{!AccList}" var="acc">
<apex:column headerValue="Name">
<apex:outputLink value="/{!acc.id}"> {!acc.name}</apex:outputLink>
</apex:column>
<apex:column value="{!acc.type}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Please let me know if u have any query on same and if this post helps you plz give KUDOS by click on star at left.
All Answers
Hi,
you can create a controller which query the records from any object and display that list into the VF with apex:pageBlockTable etc.
Controller :
public Class AccountController {
public List<Account> getAccList() {
return [select id,name,Type from Account]; // return the list of accounts.
}
}
VF :
<apex:page controller="AccountController">
<apex:form>
<apex:pageBlock title="Account Records">
<apex:pageBlockTable value="{!AccList}" var="acc">
<apex:column headerValue="Name">
<apex:outputLink value="/{!acc.id}"> {!acc.name}</apex:outputLink>
</apex:column>
<apex:column value="{!acc.type}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Please let me know if u have any query on same and if this post helps you plz give KUDOS by click on star at left.
Thanks Puja,
I'll try this code .
Regards,
R.Ambiga
I tried your code, but it is not working. I want to display some list of records and I should be able to open the record from there(VF Page). This is my requirement.
Thanks
Niranjan