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
Sascha LöfflerSascha Löffler 

Redirect VF Page to Record Detail Page

Hi together, 

i want to redirect the edit button of a custom object to the record detail page. My idea was to create a VF page that automatically redirects to record detail page, when clicking on edit. Can someone of you help me out of that with a little code snippet? 

That would be great.
Thanks and best regards

VJ_SFDCVJ_SFDC
I am really not sure about requirement but already you are on record detail page and again clicking on Edit button why you want to naviage to the record detail page. Incase if it is some other place use following vf code and overwrite edit button with your visulforce page. 

<apex:page standardController="Account">
<apex:detail subject="{!account.ownerId}" relatedList="false" title="false"/>
</apex:page>

Please let me know if you have any questions.
 
Sascha LöfflerSascha Löffler
Hi Veru, 

thanks for your fast reply, the requirement ist for the related list "edit" button, so if i click edit for a record through the related list i want to redirect to the record detail page, because the most time we edit this type of record we add or remove files and that is not possible through the standard pop-up dialoge. 

But that brings me to the next topic, is it possible to show the edit button within the related list and hide it on the record detail page?