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
mohit Srivastavamohit Srivastava 

how to get record id from detailed page

hi,
i want to get id of account record on a click of custom button and  i need that id in the cunstructor of redirecting page.. so that i can show all the record related to that id on vf page.

thanks
Balaji BondarBalaji Bondar
Hi Mohit,
You can access URL parameter using this code.
Id accountId = ApexPages.currentPage().getParameters().get('id');
OR 

You can use below code access account object in the extension controller of your visual force page on  button click action
public myControllerExtension(ApexPages.StandardController stdController) {
        this.acct = (Account)stdController.getRecord();
    }
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.