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
Pierre-François CPierre-François C 

visualforce save button return record in edit mode

Hi Everyone,

Do you know how to customize the Save button in a visualforce page, to open the new record created in edit mode, not in view mode (standard) ?
PeaceMakerPeaceMaker
Hi Pierre-Francois C,

You can use custom pagereference method for Save button action and Insert the record through code,  once it is inserted, get the ID and reload the page or redirect the page using as below..

public pagereference CustomSave(){
Insert Record;
return new PageReference('/'+Record.id+'/e');
}

Mark this as Solution if it helps you