APEX – prevent a duplicate page submit
In one of my projects, I was challenged with the fact that end users (un)intentionally submit a page more than once. As a result, multiple duplicate records are stored in the database. This kind of behavior is unwanted and has to be prevented. Apex provides a feature on page-level to avoid a page from being re-posted, but I didn’t want the end user to be redirected to the error page every time a re-post occurred (see screenshots below).
Note: This solution makes use of dynamic actions, so it is only compatible with Apex 4 and up.
On page 0 (create this page if you haven’t done it already) create a dynamic action as follows:
Right click on “Dynamic Actions” and select “Create”.
Give the dynamic action a name and click “Next”.
Select “Before Page Submit” as event for the dynamic action. Click “Next”.
Click “Create Dynamic Action”.
This will result in:
Simple and effective!