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
Marketing Marketing 27Marketing Marketing 27 

Visualforce - how to stop fields from resetting after validation error

I have a VF page that helps users make a specific type of opportunity. The values on the VF page are auto-filled with the values of the opportunity they clicked the button on. 

Some of these values they change and some they leave with their auto-filled value. However, if they click save and the page gets a validation error, then all the fields are reset to their auto-fill values. So the user loses all their work essentially.

How do I make it so that if they get a validation rule, the values don't reset?
SwethaSwetha (Salesforce Developers) 
HI,
It looks like your VF code has the validations written and these are not standard validation rules.  Can you include relevant code? 

Related: https://salesforce.stackexchange.com/questions/187272/how-do-i-save-the-pre-populated-information-on-my-vforce-page-when-the-record-is

https://salesforce.stackexchange.com/questions/10777/reset-record-after-saving-form

Thanks