# Search & Find

**URL:** <https://forum.servoy.com/t/search-find/10758>\
**Category:** Classic Servoy\
**Created:** [June 9, 2009, 4:31pm UTC](https://forum.servoy.com/t/search-find/10758 "2009-06-09T16:31:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lhale](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@lhale](https://forum.servoy.com/u/lhale)\
**Post date:** [June 9, 2009, 4:31pm UTC](https://forum.servoy.com/t/search-find/10758/1 "2009-06-09T16:31:39Z")

</div>

I get the following error when performing find & search.

Search Failed…try show all

> java.lang.NullPointerException

This error only happens in certain situations that I can replicate. I have made sure that the there are not outstanding changes to the db. Below is my error log from the app server.

java.lang.NullPointerException  
at com.servoy.j2db.dataui.Zee.setValidationEnabled(Zee.java:326)  
at com.servoy.j2db.dataprocessing.Zib.setFindMode(Zib.java:138)  
at com.servoy.j2db.dataprocessing.Zfb.Za(Zfb.java:244)  
at com.servoy.j2db.FormController.propagateFindMode(FormController.java:1003)  
at com.servoy.j2db.FormController.foundSetChanged(FormController.java:805)  
at com.servoy.j2db.dataprocessing.FoundSet.Zf(FoundSet.java:628)  
at com.servoy.j2db.dataprocessing.FoundSet.setFindMode(FoundSet.java:617)  
at com.servoy.j2db.FormController.setMode(FormController.java:683)  
at com.servoy.j2db.FormManager.Za(FormManager.java:451)  
at com.servoy.j2db.SwingFormManager.Za(SwingFormManager.java:229)  
at com.servoy.j2db.FormManager.propertyChange(FormManager.java:114)  
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)  
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)  
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)  
at com.servoy.j2db.J2DBGlobals.firePropertyChange(J2DBGlobals.java:28)  
at com.servoy.j2db.ModeManager.setMode(ModeManager.java:33)  
at com.servoy.j2db.FormController.Zc(FormController.java:515)  
at com.servoy.j2db.FormController.find(FormController.java:943)  
at com.servoy.j2db.cmd.Zt.doIt(Zt.java:8)  
at com.servoy.j2db.cmd.Zc.run(Zc.java:5)  
at java.awt.event.InvocationEvent.dispatch(Unknown Source)  
at java.awt.EventQueue.dispatchEvent(Unknown Source)  
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)  
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)  
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)  
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)  
at java.awt.EventDispatchThread.run(Unknown Source)

---

<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:** [June 9, 2009, 6:50pm UTC](https://forum.servoy.com/t/search-find/10758/2 "2009-06-09T18:50:40Z")

</div>

What version are you using?

Rob

---

<div class="post-metadata">

**Author:** ![lhale](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@lhale](https://forum.servoy.com/u/lhale)\
**Post date:** [June 9, 2009, 6:52pm UTC](https://forum.servoy.com/t/search-find/10758/3 "2009-06-09T18:52:03Z")

</div>

Version: 4.1.2 - build 663

The find problem occurred after I accessed data that had a foreign key relationship to the dataprovider value I was trying to search on. I finally came up with this work around to get my search and find to work. This problem was locking up clients. If this is not safe please let me know. All I know is if I don’t use controller.showRecords(); before my find in certain situations it will lock up the client. The function below is my form onFinCmd.

```auto
function Find()
{
  controller.showRecords();//need this code or find will not work
  controller.find();
  controller.focusFirstField();   
}

```

Thanks for any and all help

---

<div class="post-metadata">

**Author:** ![lhale](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@lhale](https://forum.servoy.com/u/lhale)\
**Post date:** [June 11, 2009, 4:41pm UTC](https://forum.servoy.com/t/search-find/10758/4 "2009-06-11T16:41:43Z")

</div>

After inserting the controller.showRecords() we have discoverd that the extended search function will not work. However, I have come across a fix that my be the solution. I have set this form to use a separate foundset. This seems to correct all of my issues. However, I don’t want to create more issues with data not being updated to the db or not being displayed to the users due to separate foundsets. I would appreciate any and all advice.

Thanks

---

<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:** [June 18, 2009, 6:10pm UTC](https://forum.servoy.com/t/search-find/10758/5 "2009-06-18T18:10:04Z")

</div>

if you have a sample that goes wrong on 4.1.3 then please attach that to a case.

---

<div class="post-metadata">

**Author:** ![lhale](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@lhale](https://forum.servoy.com/u/lhale)\
**Post date:** [June 19, 2009, 12:46pm UTC](https://forum.servoy.com/t/search-find/10758/6 "2009-06-19T12:46:00Z")

</div>

Resolved this issue by checking the useseparatefoundset option in the properties.
