+ Start a Discussion
sanjay kumar 74sanjay kumar 74 

To pass Selected Record Id in Command Button


I am creating an inline vf page on parent object which shows all child records with custom button.
Now I have done this by using command button ,so that it will redirect to another vf page ,i am able to do that by Page refernce ,now the question is how can i can pass the selected child record id into the page reference.

Apperciate if any body could help me out.

Thanks in advance
Alexander TsitsuraAlexander Tsitsura
Hi sanjay

For pass parameters to PageReference you can use getParameters().put

Please, see code below
agereference pageRef = your page reference
pageref.getParameters().put('id', your child record id);

As a common practice, if your question is answered, please choose 1 best answer. 
But you can give every answer a thumb up if that answer is helpful to you.