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
The LorenzThe Lorenz 

Not allow to open the same page.

Hi all,

 

I'm new with visualforce and I trying to do the following:

 

I have a visualforce page, which submit some data. I don't want the user could open two browser tabs with the same page, and change a value when is submitting in the other page.

 

What I have to do is not allow to open two times the same page.

 

Someone knows how to solve this problem???

 

Thanks for any help :)

 

 

 

 

ministe2003ministe2003

No real way to do that as you couldnt access the browser to see what other windows have open.

What you could do is in your submit method, before you update the record in the database, do a query and pull out the last modified date and compare that to the last modified date of the record you are about to update.  If the last modified date of the record you are about to update is older than that of the record that is already in the database then you know this record is out of date and you can stop the method before the update is performed