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
Aditya VemuriAditya Vemuri 

Redirect to vf page when record Id is given in address bar

Hi All,
I have a question whether if SFDC Id is given in address bar, can we redirect to a VF page automatically? The VF page being a detail page for a Custom Object.
Ex: Given: http://cs1.salesforce.com/aoB0000xxxxpOk in address bar,
Redirect To: http://cs1.salesforce.com/apex/<VF_Page>?id=​aoB0000xxxxpOk
 
Please help, thanks in Advance.
Aditya
Best Answer chosen by Aditya Vemuri
Nirmala  KuchiNirmala Kuchi
Redirecting to VF page while viewing custom object record can be easily acheived by overriding the view link with required VF page.

Create --> objects --> select custom object --> buttons,links and actions section --> Edit view link --> override with Visualforce page.

Thanks,
Nirmala

All Answers

Sagar PareekSagar Pareek
Have you tried overridding the detail page with custom visualforce page?
http://salesforce.stackexchange.com/questions/45432/how-do-i-use-the-same-visualforce-page-to-override-view-new-and-edit-buttons-o
Nirmala  KuchiNirmala Kuchi
Redirecting to VF page while viewing custom object record can be easily acheived by overriding the view link with required VF page.

Create --> objects --> select custom object --> buttons,links and actions section --> Edit view link --> override with Visualforce page.

Thanks,
Nirmala
This was selected as the best answer
Aditya VemuriAditya Vemuri
Thanks a lot Nirmala.. This is what I am looking for :-)
cooldamselcooldamsel
Hi Aditya,

Create a visualforce page with standard controller of your object and the extensions as your custom controller. Then in your custom controller get the id from page url using ApexPages.CurrentPage().getParameters().get('id');

Then Go to your objects and edit a button from Button, links and actions section and select the visualforce page that you have created in the previous step.