# Partial record Rollback?

**URL:** <https://forum.servoy.com/t/partial-record-rollback/15209>\
**Category:** Classic Servoy\
**Created:** [December 19, 2011, 11:03pm UTC](https://forum.servoy.com/t/partial-record-rollback/15209 "2011-12-19T23:03:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JvNoort](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@JvNoort](https://forum.servoy.com/u/JvNoort)\
**Post date:** [December 19, 2011, 11:03pm UTC](https://forum.servoy.com/t/partial-record-rollback/15209/1 "2011-12-19T23:03:02Z")

</div>

Hi,

I’m having the wish to be able to rollback some records NOT all the records on a form.  
My table has a lot of cols, so the data is spread over multiple tabpanes.

Now, if (the user) says databaseManager.rollbackEditedRecords() will undo ALL modifications, say like panel 1 to 5  
But wouldn’t it be neat if some javascript programming sould see to it that just THE CURRENT Tabpanel data gets rolledback?

I find this harder to do than I expected. I tried

```auto
var frm_v_dataset = null;

function onActionCancelEdit(event) { 
                              							     
	foundset.loadRecords(frm_v_dataset); // Roll back	
}
function onActionSave(event) {
	databaseManager.setAutoSave(true);
	databaseManager.saveData();
	databaseManager.setAutoSave(false);
}

function onShow(firstShow, event) {
	                                    // Partial rollback for 1 TabPanel only
	databaseManager.saveData()
	frm_v_dataset = databaseManager.convertToDataSet(foundset, alldataproviders);
	databaseManager.setAutoSave(false);
	
	var x = 0 // DEBUG
}

```

But that wo’nt go because of: ‘couldn’t load dataset because foundset had editted records but couldn’t save it’

Some help / ideas is appreciated…  
Regards, Jan

**PS** I do not want to split up my table for this … ![:shock:]( "Shocked")

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [December 20, 2011, 2:38am UTC](https://forum.servoy.com/t/partial-record-rollback/15209/2 "2011-12-20T02:38:41Z")

</div>

Hi Jan,

Take a look at the function databaseManager.getEditedRecords() and the JSRecord function getChangedData().  
Those might be of help for what you want to do.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 21, 2011, 2:52pm UTC](https://forum.servoy.com/t/partial-record-rollback/15209/3 "2011-12-21T14:52:50Z")

</div>

and then databaseManager.rollbackEditedRecords(recordToRollback) (6.0)
