Announcement

Collapse
No announcement yet.

No results with custom multi-enum fields in search

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

  • No results with custom multi-enum fields in search

    Hello all,

    I'm having problems with Opportunity entity. I added custom multi-enum fields, and if I try to add a search filter on the GUI based on any custom multi-enum field of mine, the following happens:
    • with Any Of option: no results
    • with None Of option: all of the rows are displayed, no matter what is the value of the field in the database
    • with All Of option: no results
    • with Is Empty option: all of the rows are displayed, no matter what is the value of the field in the database
    • with Is Not Empty option: Error 500 espo.js:12756 Server side error 500: Unknown where item type 'arrayIsNotEmpty'.

    It seems like EspoCRM considers my fields empty.

    This happens with all of my custom fields wether they were added months ago, or a few minutes ago.

    When I check the pages of my opportunity records, the multi-enum field are showing the correct values, I just can't search for them.

    What I tried to do to solve the problem:
    1. I checked the database. The fields I tried to search for are filled with the options itself, for example ["value1"] and ["value1", "value2"] so I presume it's okay.
    2. I cleared the cache and did a rebuild.
    3. I searched the forum and tried to apply this (with EspoCRM version 7.1.1), maybe helps, but the cron job failed with this message in the log: ERROR: JobManager: Failed job running, job '12346'. SQLSTATE[42S22]: Column not found: 1054 Unknown column 'target_list.including_action_list' in 'where clause'; at /
    4. var/www/html/application/Espo/ORM/SqlExecutor.php:70. [] []
    5. I upgraded to the latest EspoCRM version, 7.3.3 and Advanced Pack 2.13.4, the problem still persists.

    There are no relationships to other​ entities regarding to my custom multi-enums.

    The default multi-enums in Opportunity entity (for example Contacts) are working okay.

    Do someone have any idea to solve this problem?

    Thanks

    Attila
    Last edited by radu; 02-21-2023, 10:03 AM.

  • #2
    Hi,

    What database system (MariaDB or MySQL) and version do you have?

    Searching by multi-enums worked well on the current version as I just recently did some optimizations for the future version and tested this functionality.

    When searching, the table array_value is utilized. You can check whether you have values stored there. It could be that values were not stored for some reason (hooks didn't trigger on record save).
    Last edited by yuri; 02-22-2023, 03:22 PM.

    Comment


    • #3
      Hello yuri,

      Thanks for your reply.

      Originally posted by yuri View Post
      What database system (MariaDB or MySQL) and version do you have?
      MariaDB 10.5.18

      Originally posted by yuri View Post
      Searching by multi-enums worked well on the current version as I just recently did some optimizations for the future version and tested this functionality.
      They were worked well in the past for me too, the error is just appeared today when I tried to filter my projects in the opporunity entity. The last thing I did a few days ago, I added new multi-enums to the Opportunity entity through the standard administration area. After I realized the multi-enum filtering not working for me, I tried to search for solution and I tried this topic, but failed (sorry, the link was gone from my first post).

      Originally posted by yuri View Post
      When searching, the table array_value is utilized. You can check whether you have values stored there. It could be that values was not stored for some reason (hooks didn't trigger on record save).
      This table is absolutely empty for me.

      As far as I know, I did not do anything with this table manually.

      What do I have to do to create the data?

      Thanks: Attila
      Last edited by radu; 02-21-2023, 06:30 PM.

      Comment


      • #4
        If you run the following command in CLI it should populate values:

        Code:
        php command.php populateArrayValues Opportunity yourFieldName

        But I don't why values are not stored when you save a record.

        Comment


        • #5
          Originally posted by yuri View Post
          If you run the following command in CLI it should populate values:

          Code:
          php command.php populateArrayValues Opportunity yourFieldName
          Thanks, I tested with a field - the filtering works with that.

          Is there a function which do all entities, all fields, or I have to do a custom function in PHP? Because all of my array_values is missing, I've no clue why.


          Originally posted by yuri View Post
          But I don't why values are not stored when you save a record.
          I tested the saving method: if I edit a record, the populate function does not fire only when I modify a field and I add/remove an option. So clicking on save or update without any modification does not create the records in array_values table.

          Comment


          • #6
            It's how it's supposed to work. A value is updated only if you modify it.

            There's no an option to run the command for all fields. You need to do it for all your multi-enum fields separately.

            Comment


            • #7
              Originally posted by yuri View Post
              It's how it's supposed to work. A value is updated only if you modify it.

              There's no an option to run the command for all fields. You need to do it for all your multi-enum fields separately.
              Thanks, I'll do. I will try to observe if the array_values table go empty and come back to this topic.

              Comment

              Working...
              X