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
sanjay kumar 74sanjay kumar 74 

To pass Selected Record Id in Command Button

Hi ALL,

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.

Thanks,
Alex