Clicking save multiple times, and saving records

Clicking save multiple times, and saving records

  
Scenario A: User fill out an edit record form, the user clicks the "save" button more than once.
 
1 - will multiple records be created ? or
2 - will outsystems save the record only once?
 
Scenario B:  User fill out an edit record form, the user clicks the "save" button then clicks back to return to the same form
clicks save again, in this case outsystems will create multiple records! 

There are a number of ways to handle this but how does outsystems want the developer to handle these scenario? (ie process/save one time only).

 

Hi Robert,

I guess the quick answer would be
«It is up to the developer to predict these scenarios and act upon them the way he feels is best suited to the action being implemented.»

Cheers,
André


Hi Robert,

An easy way to prevent scenario 2 would be to make the save action an ajax action as this will make the redirect client side and avoid reposting problems (if users do not have browsers that  warn about this).

Cheers,
Tiago Simões
scenario A:
The easiest way to solve this would be to ...
-create a boolean flag (clickedsave)
-when the form is valid and the save button is clicked, set "clickedsave" to false
-disable  the save "button" by setting the button enable property to clickedsave (ie false)
-where the save button is clicked and the record has successfully been saved, set "clickedsave" to true to reset the clickedsave flag. (also reset the flag in the presentation action, or any other action where necessary)

scenario B:
-Create a random generated variable and pass it along with the form, then reset this variable once the form has successfully been saved.
or do what Tiago said, use AJAX.