# Refuse change of selected record in tableview

**URL:** <https://forum.servoy.com/t/refuse-change-of-selected-record-in-tableview/12875>\
**Category:** Classic Servoy\
**Created:** [September 15, 2010, 7:54am UTC](https://forum.servoy.com/t/refuse-change-of-selected-record-in-tableview/12875 "2010-09-15T07:54:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://forum.servoy.com/u/martinh)\
**Post date:** [September 15, 2010, 7:54am UTC](https://forum.servoy.com/t/refuse-change-of-selected-record-in-tableview/12875/1 "2010-09-15T07:54:01Z")

</div>

Hi,

Is there a way that you can refuse a change of the selected record in tableview?

I have a case where a user can add a new record in tableview  
User has to press OK button to save the record.  
Before saving record, there are some checks behind this OK button.

What I see happen, is that user presses “Add new record”.  
Then during fill of fields, the user selects another record in the tableview  
Then user presses OK button.

So the checks behind the OK button, now work on the selected record and not the new added record.

I thought maybe if I return false in the onRecordSelection event, that the record change would have been refused, but that is not the case.

Is there another way that you can rollback a change of record, so that the current record remains the one you are working on?

Martin

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [September 15, 2010, 11:03am UTC](https://forum.servoy.com/t/refuse-change-of-selected-record-in-tableview/12875/2 "2010-09-15T11:03:48Z")

</div>

Martin,

Try the form.onRecordEditStop event method.  
When this method returns false, the user cannot leave the record.

Rob
