# Data of a field suddenly turns to NULL

**URL:** <https://forum.servoy.com/t/data-of-a-field-suddenly-turns-to-null/19270>\
**Category:** Classic Servoy\
**Created:** [May 26, 2017, 10:19pm UTC](https://forum.servoy.com/t/data-of-a-field-suddenly-turns-to-null/19270 "2017-05-26T22:19:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![palacio](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@palacio](https://forum.servoy.com/u/palacio)\
**Post date:** [May 26, 2017, 10:19pm UTC](https://forum.servoy.com/t/data-of-a-field-suddenly-turns-to-null/19270/1 "2017-05-26T22:19:00Z")

</div>

Hi!

I would like to ask if there’s a bug in Servoy 5.2 that suddenly turns a value of field into NULL. FYI this field  
is automatically generated by our program before it goes to the next steps,  
We are experiencing it in our software and I already checked all things , all the forms all the modules that  
this field was used and I can’t find the where we programmers wrote a bad code. I was looking for human error  
but I didn’t found anything.

Do these things happen when you lock a record?  
We have tried also cleaning the java cache and deleting the folder “.servoy” for every user that had this problem.

Hope that someone had already experienced this anomaly.

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:** [May 29, 2017, 9:55am UTC](https://forum.servoy.com/t/data-of-a-field-suddenly-turns-to-null/19270/2 "2017-05-29T09:55:59Z")

</div>

are you doing find/search over those tables?  
and then maybe don’t check it the foundset is really getting into find?

---

<div class="post-metadata">

**Author:** ![palacio](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@palacio](https://forum.servoy.com/u/palacio)\
**Post date:** [June 2, 2017, 8:23am UTC](https://forum.servoy.com/t/data-of-a-field-suddenly-turns-to-null/19270/3 "2017-06-02T08:23:22Z")

</div>

> jcompagner:  
> are you doing find/search over those tables?  
> and then maybe don’t check it the foundset is really getting into find?

Yes, I saw that sometimes to beat the deadline we forget to analyze our codes better  
we often use :

```auto
controller.find();
    field = "somethonhing"
controller.search()

```

also with foundset , so you are saying that this is the cause of our problem ?

I also notice that sometimes we use a relation of form like this:

form.nameOFform.relation\_to\_relation

shouldn’t it be like this :

form.nameOFform.foundset.relation\_to\_relation

palacio

---

<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 2, 2017, 8:50am UTC](https://forum.servoy.com/t/data-of-a-field-suddenly-turns-to-null/19270/4 "2017-06-02T08:50:07Z")

</div>

you should always test if something really goes into find:

if (controller.find()) {  
}  
else {  
}

that relation lookup is the same, its more that you always should know which record to do it on so

record.relation

but the form.relation or form.foundset.relation just means selected record. So if you are sure that that is the one you want then both should be fine
