Announcement

Collapse
No announcement yet.

Include foreign field to be searched in recordlist

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

  • Include foreign field to be searched in recordlist

    Update : this has been resolved in version 5.6.0

    I have an entity called Tickets.

    It has an N:1 relation with Accounts

    There is a foreign field Tickets.accountname = linking to = > Account.name

    The recordlist shows nicely Account.name, as expected.

    The problem is that the search bar in the recordlist of Tickets does not search in the Account.name.

    This is confusing for users. How do I set that?

    Last edited by rinorway; 04-13-2019, 12:18 PM. Reason: this option has been added in version 5.6.0

  • #2
    Hi.
    This is not implemented, because local search is searching by the name attribute. If you want to search by account name there only one thing that you can do is to add the Account field to the search filter of the Tickets entity in the Layout Manager and search via filter.

    Comment


    • #3
      Maximus but that is must have function. On email entity too, if I create contact, so I cannot find by contact name in standart search bar..

      Comment


      • #4
        Possible workaround : create a searchable field that you periodically fill with all elements you would like to search on, and include that searchfield in the "search columns" (entity definition)

        - ESPO : create field ticket.searchfield, type TEXT
        - MySQL : create view update_ticket ( select ticket.id, concat_ws(" ", ........ here all the fields you need to search on ... )
        - MySQL : set event to use the view to update the ticket.searchfield.

        Code:
        CREATE EVENT `espo`.`update_ticket_search` ON SCHEDULE EVERY 10 MINUTE
        DO BEGIN ( UPDATE ticket target
        INNER JOIN update_ticket source ON source.id = target.id
        SET `target`.`searchfield` = `source`.`searchfield` ;) END

        But best would be to be able to include foreign searchfields indeed.
        Last edited by rinorway; 03-31-2019, 08:46 AM.

        Comment


        • #5
          This has been added as a feature in version 5.6.0 Maximus bilazz
          See administration->Entitymanager->Edit entity -> Text Filter Fields

          Very nice to have this included.

          Comment

          Working...
          X