Search returns rows when it shouldnt

So I have a numeric field and perform a search for that fields equals a parameter sent.

if (tbltransactions.find())
{
        tbltransactions.idtran = paramId
        var nRows = tbltransactions.search()
}

Ok, no confusion there. Now, when the paramId variable contains an empty string, the search returns all rows! The reason why it can be an empty string is because it comes from an XML sent to a WebService. This can be easily fixed by validating the type of data of the parameter or checking if its an empty string, that’s what I’m doing so no problem there.
The issue is, is that the way it should behave? I understand I shouldnt be comparing different datatypes, maybe I’m missing something, but wouldnt it be more appropriate for it to return 0 rows instead?

Working with Version: 6.1.0 - build 1418

Regards,

JD

JD,

Find() can be used from scripting, but also from the UI in find mode.
From the UI, you don’t want to include conditions for fields that are left blank by the user, so we only add conditions for non-empty values.

Hope this helps,
Rob

Hey Rob,

Thanks for the reply. I understand that we shouldnt add conditions with empty values since I’ve seen the result of that. Im posting so that I can get input on whether this is the intended behaviour (I couldnt fin it in the documentation) or of its a bug and also to help other people to look out for this when performing searches.

Regards,
JD