Search filter using different entity data not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manosingh
    Member
    • Apr 2019
    • 62

    Search filter using different entity data not working

    Hi i face the search issue in the grid listing please find the below explanation

    1. I created a custom entity
    2. And then i created a relationship "Many-to-One" with the Lead entity
    3. Now i added the fields for Lead in the Grid listing and the detail page of my custom entity
    4. I created a test data in my entity with the lead Name selected
    5. And i can able to see the Lead name in the Grid listing
    6. However when i try to filter data using Lead Name in my custom entity grid listing it shows "No Data"
    7. I added the Lead entity in the Search Filters options available in the Layout manager still its not working.

    Is there anyway i can fix this ? , help me out in this , Thanks in advance Cheers


  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hello.
    If you have added the Lead entity in the search filter you should use the filter. If you try to find this record w/o filter you should add the Lead.First Name and Lead.Last Name to the "Text Filter Fields" field in the Administration -> Entity Manager -> Lead -> edit.

    Comment

    • manosingh
      Member
      • Apr 2019
      • 62

      #3
      I added the First Name and Last Name in the Entity Manger -> Lead -> Edit option , but i can't able to filter this data in my custom entity Grid listing where i mapped the Lead name ,

      Actually i need to filter data of Lead inside my custom entity grid listing where i added the relationship Many to one of lead in my custom entity, Hope you understand my doubt.
      Last edited by manosingh; 06-24-2019, 09:30 AM.

      Comment

      • Maximus
        Senior Member
        • Nov 2018
        • 2731

        #4
        Oh sorry. The same way but for your custom entity. Entity Manger -> Custom entity -> Edit option.

        Comment

        • manosingh
          Member
          • Apr 2019
          • 62

          #5
          Thanks for the response Maximus , i checked the custom entity edit option "Text Filter Fields" in that drop down it shows fields of that entity only not my relationship added entity details.

          Comment

          • Maximus
            Senior Member
            • Nov 2018
            • 2731

            #6
            If you have created the relation between your custom entity and the Lead entity that parameters should be in the list. Please try to reload the web page and check it again.

            Comment

            • manosingh
              Member
              • Apr 2019
              • 62

              #7
              i tried but its not working

              I cleared cache and did rebuild too , still it doesn't works

              Comment

              • Maximus
                Senior Member
                • Nov 2018
                • 2731

                #8
                Weird. Ok, try to do it manually. Go to EspoCRM/custom/Espo/Custom/Resources/metadata/entityDefs and find a JSON file with your custom entity name. After the 'links' and before the 'indexes' blocks add this block:
                Code:
                "collection": {
                        "orderBy": "createdAt",
                        "order": "desc",
                        "textFilterFields": [
                            "name",
                            "lead.firstName",
                            "lead.lastName"
                        ],
                        "fullTextSearch": false
                    },
                Save the file and make the rebuild.

                Comment

                • manosingh
                  Member
                  • Apr 2019
                  • 62

                  #9
                  Great Awesome it worked thank you very much Maximus

                  Comment

                  Working...