I`ve got an issue with finding data which can contain null or empty values.
How can I get both values in one singleline “AND” search request (Servoy find request).
To give you an idea what I`m doing:
I offer the clients to store there find requests as they have entered it and run it anytime they like to, using a single find form on which all the data can be reached.
Is it possible using an OR statement within a AND search for these finds eg. ^||=
On which the Servoy search engine translates it into
Field1 = Value1
Field2 = null or empty
Field3 = Value2
Field4 = Value3
Field5 = null or empty
Because SQL differs between null and empty values you always have to duplicate your request (the user is not aware of this so his found set is not, what he wants to ask).
The method I`ve created runs through all the fields on a find form and alters the value according to fieldtype and stores the value if desired.
With an OR requests to split up null and empty request. I`ve got to run through all the fields and then after all fields are processed. when one or more fields has been entered as null or empty, duplicate that search record and replace the values, which were entered as null or empty, from eg. null to empty. This complicates it quit a bit.
I believe that most find requests initialized by users wanting a to find an empty value dont care if its a virgin field (null) or a cleared field (empty).
Thats why Im asking to implement such a find in the standard servoy search method (as option or by entering ‘^||=’ as search request) if this is not possible yet.
Field1 = Value1 (Field2 IS null OR Field2 = '') Field3 = Value2 Field4 = Value3 (Field5 IS null OR Field5 = '')
no the “^=” will not work in a JavaScript expression, use:
if (a == null || a == “”)
If doing a find from within a script the “^=” will work as field data, like:
controller.find()
customername = “^=” //search for null or empty
controller.search()