Announcement

Collapse
No announcement yet.

Allow searching for empty values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Allow searching for empty values

    In list views it should be possible to search for empty field values, e.g. for a date field where no date has been entered, for a bool field that is unchecked or for a text field without any text in it. If that's too complex, a negation option ("NOT" operator) for each search criteria could be an alternative.

    I have defined a custom field of type "date" in the opportunities entity. Now, I would like to search for all opportunities where this field is empty, but

  • #2
    * There is no unchecked bool fields by design. It can be true or false.
    * For text fields its' already implemented

    Comment


    • #4
      Thanks, you are right, I overlooked the "is empty" item for text fields.

      For bool fields I cannot see how to search for false values, i.e. (to speak in UI terms) search for records where the checkbox is unchecked. When I add a bool field as search criteria and start the search without checking it, the result list is always empty.

      BTW, it's the same with most numeric fields. I didn't check all types, but at least currency, integer and float fields don't have an "is empty" item in their search operator list.

      Comment


      • #5
        Regarding bool. I've looked into code. It should return all records with false value if checkbox in filter is not checked.

        Maybe there are NULL values in database by default for your bool field. That's could be another issue we need to fix. Can you check if there are NULL values for your bool field?

        I tried to create new bool field and all existing records were populated with FALSE value. Tried filter by bool field to search records with FALSE value and it worked well.
        Last edited by yuri; 09-14-2016, 06:02 PM.

        Comment


        • #6
          In the database column of my bool field there are indeed many NULL values. But when I create a new bool field, all records are populated with 0 (FALSE), and searching for FALSE values is working correctly. So, in principle everything is okay.

          I am not sure why the other bool field contains NULL values, but it might be due to the fact that previously I had a date field with that same name. I removed it via entity manager and re-created it with type bool. Could this be the issue? I have tested around a little bit, and apparently columns are not removed from database tables when fields are removed via entity manager, which is good, I think, but might lead to this kind of problem.

          Comment


          • #7
            Yes. It could be the reason.

            Comment

            Working...
            X