Page 1 of 1

Data of a field suddenly turns to NULL

PostPosted: Sat May 27, 2017 12:19 am
by palacio
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.

Re: Data of a field suddenly turns to NULL

PostPosted: Mon May 29, 2017 11:55 am
by jcompagner
are you doing find/search over those tables?
and then maybe don't check it the foundset is really getting into find?

Re: Data of a field suddenly turns to NULL

PostPosted: Fri Jun 02, 2017 10:23 am
by palacio
jcompagner wrote: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 :

Code: Select all
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

Re: Data of a field suddenly turns to NULL

PostPosted: Fri Jun 02, 2017 10:50 am
by jcompagner
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