# rollback data

**URL:** <https://forum.servoy.com/t/rollback-data/15638>\
**Category:** Classic Servoy\
**Created:** [March 8, 2012, 10:34am UTC](https://forum.servoy.com/t/rollback-data/15638 "2012-03-08T10:34:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![info](https://avatars.discourse-cdn.com/v4/letter/i/c77e96/32.png) [@info](https://forum.servoy.com/u/info)\
**Post date:** [March 8, 2012, 10:34am UTC](https://forum.servoy.com/t/rollback-data/15638/1 "2012-03-08T10:34:26Z")

</div>

Hi

I’ve a form and in this form I’ve some fields and two button.  
All fields are connected to a database and my users can edit this fields.  
One button is for cancel the changes.  
There is a default function for replace old data in the fields?

thanks for help!

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [March 8, 2012, 11:15am UTC](https://forum.servoy.com/t/rollback-data/15638/2 "2012-03-08T11:15:53Z")

</div>

Take a look at databaseManager.rollbackEditedRecords() (Best used when autosave is set to false).

---

<div class="post-metadata">

**Author:** ![info](https://avatars.discourse-cdn.com/v4/letter/i/c77e96/32.png) [@info](https://forum.servoy.com/u/info)\
**Post date:** [March 8, 2012, 11:58am UTC](https://forum.servoy.com/t/rollback-data/15638/3 "2012-03-08T11:58:28Z")

</div>

> Joas:  
> Take a look at databaseManager.rollbackEditedRecords() (Best used when autosave is set to false).

Perfect. With the autosave set to false is perfect.

Thanks!

---

<div class="post-metadata">

**Author:** ![djlapin](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@djlapin](https://forum.servoy.com/u/djlapin)\
**Post date:** [April 23, 2012, 9:02pm UTC](https://forum.servoy.com/t/rollback-data/15638/4 "2012-04-23T21:02:35Z")

</div>

Joas,

I know this is an old thread.

Does the rollback not work when autosave is on? In my tests here, it appears to work even if autosave is on. I can click away from one field, so that autosave should engage to save the record. But when I cancel, the record returns to the pre-edit state.

Thank you,  
Don

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [April 24, 2012, 6:59am UTC](https://forum.servoy.com/t/rollback-data/15638/5 "2012-04-24T06:59:31Z")

</div>

if you don’t click outside the fields on a form it works!. if yout click outside a field on a form (the data will be saved!!) after that, servoy can’t rollback. So to be save, autosave, should be OFF.

---

<div class="post-metadata">

**Author:** ![djlapin](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@djlapin](https://forum.servoy.com/u/djlapin)\
**Post date:** [May 3, 2012, 3:40pm UTC](https://forum.servoy.com/t/rollback-data/15638/6 "2012-05-03T15:40:32Z")

</div>

Hi Harjo,

I have tried clicking outside the field, into another field, even away from the browser window. If I press “Cancel” it doesn’t save the changes, even though autosave is on.

Is it possible this is a difference in behavior between the web client and the Smart Client?

Thank you,  
Don

 ![Tracking.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/7/7fa71770e9715ee3c9339898bb97cc531076f3f2.png)

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [May 4, 2012, 8:13am UTC](https://forum.servoy.com/t/rollback-data/15638/7 "2012-05-04T08:13:10Z")

</div>

ahh, I was talking about smart-client.  
I think, in webclient it will auto-save, when you navigate away to a different form.  
(clicking outside a field on the form, does’nt do anything, I believe in webclient)

---

<div class="post-metadata">

**Author:** ![djlapin](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@djlapin](https://forum.servoy.com/u/djlapin)\
**Post date:** [May 7, 2012, 5:27am UTC](https://forum.servoy.com/t/rollback-data/15638/8 "2012-05-07T05:27:48Z")

</div>

Hi Harjo,

This autosave setting is affecting my validation scheme, where missing items appear in a tab-panel list at lower left, on the data entry form (see picture).

I can create the validation records without saving, as long as the list uses a relation. But when I try to sort them, the console complains about not being able to sort a foundset with edited records.

Is there a work-around?

Also, can someone from Servoy confirm that the web client works this way (no updates until posting the form)?

Thank you,  
Don

Servoy 6.0.6/1232

 ![DataEntry_2.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/2/2927558e9eb8f40abf714c22d2763c3f34597d7d.png)

 ![DataEntry_1.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/2/28ba0925d035adcd8313c67eaa1c246683a078c7.png)
