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
sreejasreeja 

what is the use of ApexPages.currentPage().getParameters().get('recordId'),

can anybody explain with a example where this scenario is used  in a simple manner,  i have gone through differnt examples , bt iam unable to understand it >>ApexPages.currentPage().getParameters().get('recordId') 
Best Answer chosen by sreeja
Prema -Prema -
Hello Priya,

Suppose you want to get the ID of the current record detail page and you want to show it on your VF page once you click on the button then you can use ApexPages.currentPage().getParamaters().get('id'); It will get the id of that objects record. You can also get the name instead of id like 
public Opportunity currentRecord{get; set;}
currentRecord=ApexPages.currentPage().getParamaters().get('name') and if you want to see the value on developer console you can use System.debug(currentRecord);
Please let me know if it helps

All Answers

Prema -Prema -
Hello Priya,

Suppose you want to get the ID of the current record detail page and you want to show it on your VF page once you click on the button then you can use ApexPages.currentPage().getParamaters().get('id'); It will get the id of that objects record. You can also get the name instead of id like 
public Opportunity currentRecord{get; set;}
currentRecord=ApexPages.currentPage().getParamaters().get('name') and if you want to see the value on developer console you can use System.debug(currentRecord);
Please let me know if it helps
This was selected as the best answer
@@@we@@@@@@we@@@

ApexPages.currentPage().getParameters().get('recordId'),
use to get record  id your current  page  
http://www.sfdcpoint.com/salesforce/get-current-record-id-salesforce/
https://www.cloudforce4u.com/2013/07/get-current-record-id-salesforce.html
sreejasreeja
thank you prema and @@we@@
szad khnszad khn
internet ki jnakari (https://indiakabest.in) india ka best internet ki jankari hindi me

paytm mobile recgarge (https://indiakabest.in/paytm-mobile-recharge-kaise-kare/)
Aman Singh 213Aman Singh 213
TechTutr.com (https://techtutr.com (https://techtutr.com/))
Which of the following correctly describes NIMS (https://techtutr.com/which-of-the-following-correctly-describes-nims/)
LM 10LM 10
With an astounding legacy that spans over two and half decades, Alliance University (https://aee.alliance.edu.in) has transformed generations of aspirants, a testament of which is a thriving network of over 30,000 alumni proving their mettle across diverse fields and geographical boundaries. Currently ranked 25th in Law and 87th in Management by NIRF, 2023 and with a diamond rating by QS I-Guage for learning, facilities, and employability, Alliance University ranks among the top higher education institutions across the country.

At Alliance University, the infrastructure is unparalleled, representing the epitome of excellence spread across 60+ acres of green campus. The University boasts of 80+ amphitheater classrooms, world-class library, learning center, activity center, food courts, cafes, sports and recreational facilities and an administrative block equipped with cutting-edge technology.

The teaching-learning community at Alliance is rich in cultural and intellectual diversity. The University sustains a culture that promotes inclusiveness, tolerance, and acceptance to ensure transformative learning with diverse perspectives. With rich industry experience and academic backgrounds par excellence, the faculty at Alliance is a unique ensemble of scholars and public intellectuals from India and abroad.