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
Ashok S 7Ashok S 7 

How to Navigate the page by using <apex:outputlink>

Hai,
My requirment is when i click on list page that means i created output link for id click that id it will navigate to record view page but it is not displaying values to the record view page
i write vf page and code
vf page
=----------------------
<apex:page controller="list_controller1" sidebar="false" tabStyle="Employee_Information__c">
<apex:form >
<apex:pageBlock title="Employee List">
<apex:pageBlockSection title="Employee Information Displaying ">
<apex:pageBlockTable value="{!empdetails}" var="e">
<apex:column headerValue="ID">
<apex:outputLink value="https://c.ap2.visual.force.com/apex/Record_detail_Vf_Page?id = e.id">{!e.id}</apex:outputLink>
</apex:column>
<apex:column value="{!e.First_Name__c}"/>
<apex:column value="{!e.Middle_Name__c}"/>
<apex:column value="{!e.Last_Name__c}"/>
<apex:column value="{!e.Date_of_Birth__c}"/>
<apex:column value="{!e.Father_Husband_Name__c}"/>
<apex:column value="{!e.Marital_Status__c}"/>
</apex:pageBlockTable>

</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

controller
------------------------------
public class list_controller1
{

    public Employee_Information__c[] getEmpdetails()
    {
        empdetails = Database.query(query);
        return empdetails;
    }

    Employee_Information__c[] empdetails;
    string query = 'select id,First_Name__c,Middle_Name__c,Last_Name__c,Date_of_Birth__c,Father_Husband_Name__c,Marital_Status__c from Employee_Information__c';

    

}

please help me any one
User-added imageUser-added image

in the first image i click the id link it will navigate to secong image but here values are not displaying for fields .
please help me
any one
Best Answer chosen by Ashok S 7
PrabhaPrabha
Make sure there are no spaces in the link. It should be: 
..../apex/Record_detail_Vf_Page?id={!e.id}" 

and test it with Development mode off.

All Answers

AnjithKumarAnjithKumar
Hello Ashok,

You need to specify {!e.Id} instead of e.id in the value attribute of the output link.

Please replace the following line
<apex:outputLink value="https://c.ap2.visual.force.com/apex/Record_detail_Vf_Page?id = e.id">{!e.id}</apex:outputLink>
With following line.
<apex:outputLink value="https://c.ap2.visual.force.com/apex/Record_detail_Vf_Page?id = {!e.id}">{!e.id}</apex:outputLink>

Let me know if you need any help. I will more than happy to help you.
Ashok S 7Ashok S 7
when i replace your code it will redirect to the i created vie page  but values are not coming
 
PrabhaPrabha
Make sure there are no spaces in the link. It should be: 
..../apex/Record_detail_Vf_Page?id={!e.id}" 

and test it with Development mode off.
This was selected as the best answer
Ashok S 7Ashok S 7
Thanks for helping
VRKVRK
Hello Askhok
here i have one quesiton
<apex:outputLink value="https://c.ap2.visual.force.com/apex/Record_detail_Vf_Page?id = <b>e.id</b>">{!e.id}</apex:outputLink>

here https://c.ap2.visual.force.com  is sandbox URL ....if i move these changes to production , it wont work, becuase URL is differet like https://c.ap2. XXX. XXX. visual.force.com

so, how can we maintain production url / dynamic URL , depends on sandbox ?

pls let me know ...Thanks Ram

 
VRKVRK
i got solutioon............pls ignore my request ..Thanks