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

Passing record id to visualforce page

I have one visualforce page which is storing data in an object.

It also has link to another visualforce page.

How can i pass record id of that object to second visualforce page?


when you are calling the second page send a parameter using apex param if you are using apex components or you can construct the url and add the parameter to the url...



if it is <apex:outputlink>  then add <apex:param> 


if it is a html link use /apex/pagename?var='value'/merge field


I dont need to pass the id directly. The page should take the id and automatically read fields' values from different objects and also read the loggedin user for that session and display the user's name.

Is it possible?

If so, how?



You can get user details from user object ... like 




it returns user details of loggedin user.