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
gobear-01gobear-01 

Browser "Back" button issue

 

Hi,

 

We developed a wiard using few Visualforce pages that allow users to enter a few inputs, then insert a few new records based on users' parameters.  The problem we're seeing is that if users click the browser "Back" button, some time duplicated records are inserted into our system.  Anyone has similar experience, and I appreciate any feedbacks or work-around suggestions.

 

Thanks,

Klein

bob_buzzardbob_buzzard

This is the behaviour of the browser rather than Visualforce.  If the previous browser page was created by submitting a form (which created the records), pressing the browser back button will resubmit the form.  Some browsers warn you if this is taking place, but I doubt you can rely on it.

 

A common way around this is to carry out a client side redirect to a view page after the form records have been inserted, but that still means the user can press the back button twice and resubmit the form.

MichaelAnthonyMichaelAnthony

Can you give some detail on the client side redirect? I am not sure on the how to pull that off. I am having the same issue as the poster. I have a custom button that calls a VF page that auto runs code and creates a new case. However, if the user hits the browers back button, the browser directs them to the VF page and the code runs again and a new case is created.