# Problems with OnError global method execution

**URL:** <https://forum.servoy.com/t/problems-with-onerror-global-method-execution/11168>\
**Category:** Classic Servoy\
**Created:** [September 18, 2009, 6:50pm UTC](https://forum.servoy.com/t/problems-with-onerror-global-method-execution/11168 "2009-09-18T18:50:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProRM](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/prorm/32/4861_2.png) [@ProRM](https://forum.servoy.com/u/ProRM)\
**Post date:** [September 18, 2009, 6:50pm UTC](https://forum.servoy.com/t/problems-with-onerror-global-method-execution/11168/1 "2009-09-18T18:50:09Z")

</div>

Hi All,

We have problems with database errors validation using a global method attached to the OnError Event for the solution.

1. It works if using autoSave true on the SmartClient

2. it doesn´t work if using autoSave true on the WebClient  
The same solution with autoSave in true, validates on the SmartClient but does not using WebClient

3. it doesn´t work if using autoSave false  
With autoSave in false it seems that the OnError is not working at all

By database errors I mean duplicate primary key or null columns entered into a column that does not accept Nulls.

Servoy version is 4.1.3

Best regards,

---

<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:** [September 20, 2009, 7:07pm UTC](https://forum.servoy.com/t/problems-with-onerror-global-method-execution/11168/2 "2009-09-20T19:07:27Z")

</div>

when is the data saved?

when do you expect that the onError() is called when autoSave is false?  
when you call databaseManager.saveData();
