Skip to main content

Posts

Showing posts from August, 2016

Prevent a duplicate page submit

In one of my project, I try to find the solution for fact that the user unintentionally submit the page more than once. Let's suppose that you have two buttons on one page both of them run submit after click on it. This submit run similar DML in DB. If you have poor internet connection to application server you got chance to click on both buttons before page is refreshed. Apex provides an attribute on page-level "Allow duplicate page submissions page". As the name implies, this attribute determines whether a single page can be submitted more than once. By default, this attribute is set to "Yes - Allow page to be re-posted". User than submit the same page twice. Therefore, in most cases this attribute should be disabled by setting it to "No - Prevent page from being re-posted". The disadvange of this solution is that users are redirected to error page every time a re-post occurred and got an error " ERR-3331 This page was already submitted and