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
SS KarthickSS Karthick 

Passing value to controller

Hi Folks,
      Can anyone tell me how to pass the id value to the controller of current page??

Give some sample programs if possible

Thanks in advance
Karthick

Best Answer chosen by SS Karthick
Grazitti TeamGrazitti Team
Hi,

To get Id from the url parameters, use following code in controller:
ApexPages.currentPage().getParameters().get('id');


Please refer the below links for more details.
https://developer.salesforce.com/forums/ForumsMain?id=906F000000093yWIAQ
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008qv3IAA
https://developer.salesforce.com/forums/ForumsMain?id=906F000000096stIAA

Please mark it best if it helps you.

Regards,
Grazitti Team
www.grazitti.com

All Answers

ShashForceShashForce
Hi Karthick,

This should help: http://www.mindfiresolutions.com/How-to-pass-ID-in-Visualforce-1578.php

Thanks,
Shashank
Ramu_SFDCRamu_SFDC
The below article might help

http://www.mindfiresolutions.com/How-to-pass-ID-in-Visualforce-1578.php
Grazitti TeamGrazitti Team
Hi,

To get Id from the url parameters, use following code in controller:
ApexPages.currentPage().getParameters().get('id');


Please refer the below links for more details.
https://developer.salesforce.com/forums/ForumsMain?id=906F000000093yWIAQ
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008qv3IAA
https://developer.salesforce.com/forums/ForumsMain?id=906F000000096stIAA

Please mark it best if it helps you.

Regards,
Grazitti Team
www.grazitti.com
This was selected as the best answer
Madhan Raja MMadhan Raja M
Hi Karthick,

In the controller use the below code:

Id RecordID = System.currentPageReference().getParameters().get('id');

RecordID contains the ID of the current page.

Regards,
Madhan Raja M
Gaurav NirwalGaurav Nirwal
Please use this link which can help you 

 http://www.mindfiresolutions.com/How-to-pass-ID-in-Visualforce-1578.php
Gaurav NirwalGaurav Nirwal
And another method is You can prefer this link

https://developer.salesforce.com/forums/ForumsMain?id=906F00000008qv3IAA