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
Sugandhi VermaSugandhi Verma 

not getting the details on 2nd visualforce page

hi, i want create 2 visualforce page with a controller using custom object.In the first page i want select the one record and pass it's id to another visual force page which will show it's details using query string.
Best Answer chosen by Sugandhi Verma
RishavRishav
Hii, 

 You need to first pass the ID or any other value on the basis of which you want to show records in next page .
 you can do like this 
Directly use the Link on VF page ,Examplel :  <apex:outputlink value="/apex/vfpageName?id=anyaccountid">
or , 
you can use any action in controller to navigate another page but there also u need to give this querystring. 

2. Now u need to receive this value in a string variable inside controller of second page 
    Ex: ControllerCl cl = new controllercl(){
   
String queryString ='';
queryString = ApexPages.currentPage().getParameters().get(id);
 
   
}
Now u can use this querystring value to fetch the data inside your SOQL .

For more detail follow this link : http://www.oyecode.com/2013/08/how-to-read-page-parameters-quickly.html

Thanks
Rishav