function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
k sfdck sfdc 

How to display detail page for that record?

Hi,
        I displayed all records with in the pageblock table.In this pageblock table i gave one column as a Commandlink, when user click this command link ,how to display detail page for that record(customly like output fields)?

please help me....
Prem_PalPrem_Pal
Well, having some code would definitely help me!

However, I am assuming you are showing a list of a custom object e.g. MyCustomObject__c.

So, in you controller you have this list like 

List<MyCustomObject__c> myList {get;set;}

And you can have a page that looks something like this

<apex:pageBlock title="My Content">
	<apex:pageBlockTable value="{!myList}" var="item">
		<apex:column> 
		<apex:outputLink value="/{!item.Id}">View</apex:outputLink>
		</apex:column> 
	</apex:pageBlockTable> 
</apex:pageBlock>

Here the line will open your detail page that you have asked for

<apex:outputLink value="/{!item.Id}">View</apex:outputLink>

Hope this helps!

Thanks,
Prem

Virendra ChouhanVirendra Chouhan
Hi k sfdc,

This will help you.
<apex:page standardController="Account" recordSetVar="accounts">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection columns="1">
            <apex:pageBlockTable value="{!Accounts}" var="acc">
                <apex:column >
                    <apex:commandLink value="{!acc.name}" action="{!URLFOR($Action.account.view,acc.id)}"/>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>


k sfdck sfdc
Hi,
          Without using Id how to give custom functionality(customly means not eitable fields output fields)
Prem_PalPrem_Pal
I am finding it difficult to understand your question here!
Virendra ChouhanVirendra Chouhan
You want to open another vf page where some fields are show not all ?
k sfdck sfdc
 Hi,
       iN MY PAGEBLOCKTABLE columns like   name,number,phone i gave   
 Number a link, When clicked, take the viewer to the detail page for that record.
 provide pagination and show 25 records per page.

help me.

Prem_PalPrem_Pal
Are you talking about $Action.List, by any chance!!!!
k sfdck sfdc
hi,

             yes

Virendra ChouhanVirendra Chouhan
<apex:page standardController="Account" recordSetVar="accounts" >
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection columns="1">
            <apex:pageBlockTable value="{!Accounts}" var="acc">
                <apex:column headerValue="Account Name">
                    <apex:outputField value="{!acc.name}"/>
                </apex:column>
                <apex:column headerValue="Account Number">
                    <apex:commandLink value="{!acc.accountnumber}" action="{!URLFOR($Action.account.view,acc.id)}"/>
                </apex:column>
                <apex:column headerValue="Phone">
                   <apex:outputField value="{!acc.phone}"/>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>
When you click on Account number then it'll redirect you to that account's detail page.
Ravikant kediaRavikant kedia
Hi, 
     If you want to go in detail page for selected record then you have to give id and base on this id you can go in detail page.
k sfdck sfdc
Hi,
           Using outputtext how to display standard detail page customly in an visualforce page?