You need to sign in to do that
Don't have an account?
Bharatsingh Rajpali 6
I have a Sales_office__c object and one of its record named as Big Bazar .....now I want to make a custom button which will redirect me to a visualfore page that will display id of big bazar page
How can I pass id of Big bazar record to my visualforce page via. Custom button
You can add a merge field in the URL and then access that from the parameter in the VF page.
Eg: let's say that your VF page is display_id. Then you can use the following link in your custom button:
/display_id?tgtid={!Sales_office__c.Id}
After that if you have an apex controller in your VF page then you can use the following code to get the parameter in the controller:
Or if you want to directly access it in the VF page then you can use the following code:
Hope that answers your question.
All Answers
You can add a merge field in the URL and then access that from the parameter in the VF page.
Eg: let's say that your VF page is display_id. Then you can use the following link in your custom button:
/display_id?tgtid={!Sales_office__c.Id}
After that if you have an apex controller in your VF page then you can use the following code to get the parameter in the controller:
Or if you want to directly access it in the VF page then you can use the following code:
Hope that answers your question.