You need to sign in to do that
Don't have an account?

pass the Id to the VF page's URL from class and to get the Id from the VF page's URL into the class
How do I pass the record Id to the URL of the VF page from the class??
How can I get the record Id from the URL of the VF page into the class??
Id=apexpages().currentpage().getparameters().get('id');
2. on click of the button you can use the below code to pass the id to url.
PageReference requestPage = new pagereference('/apex/pagename?id='+id);
return requestpage;
All Answers
Id=apexpages().currentpage().getparameters().get('id');
2. on click of the button you can use the below code to pass the id to url.
PageReference requestPage = new pagereference('/apex/pagename?id='+id);
return requestpage;
example :
<apex:param name="q" value="{!contact.name}"/>
then use
apexpages().currentpage().getparameters().get('q');