Find puzzle

The following produces unexpected results. The field cpj_peo_id is an integer field.

var peo_id = arguments[0]; // argument[0] = 12
controller.find();
cpj_peo_id = peo_id; // places 12.0 into cpj_peo_id
controller.search(); // returns 0 records

If I enter find mode and manually enter “12” into the field I get the results I expect. If I enter find mode and enter “12.0” into the field I get the results I expect. Yet if I use a method, it fails.

Puzzled.

What happens if you do a parseInt on peo_id before you use it in the search?

patrick:
What happens if you do a parseInt on peo_id before you use it in the search?

Worked out a different route.

Also something tells me Servoy people have said before that finding by going into Find mode a la FMP isn’t currently supported but is coming.

Who told you this:

that finding by going into Find mode a la FMP isn’t currently supported but is coming.

I use that all the time. Your code should work perfectly well if you manage to get the right value inserted.

patrick:
Who told you this:

that finding by going into Find mode a la FMP isn’t currently supported but is coming.

I use that all the time. Your code should work perfectly well if you manage to get the right value inserted.

If memory serves, Johan. But don’t quote me on it. :wink:

Using

controller.find()
somefield = somevalue
controller.search()

is THE way of finding data using a method. Of course, there is other possibilities, but this is basically what Servoy offers you. But maybe that is not what you mean by “going into Find mode a la FMP”?

patrick:
Using

controller.find()

somefield = somevalue
controller.search()




is THE way of finding data using a method. Of course, there is other possibilities, but this is basically what Servoy offers you. But maybe that is not what you mean by "going into Find mode a la FMP"?

Exactly what I mean. I’ve had problems with it before and then again recently.

I went into programmed Find mode because I couldn’t get a relationship or SQL query to work for me. Then I was able to get a relationship working in this particular situation. Johan or someone said or seems to have said a reworking of the underpinings of Find mode were going to be rebuilt. I could be misremembering or misunderstanding. It wouldn’t be the first time.