OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions SearchHandler: Use relation for title

This topic contains 3 replies, has 2 voices, and was last updated by  cardiac 8 years, 2 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34029

    cardiac
    Participant

    Hi all,

    I tried to use the fields of a related entity as title for autocomplete.
    I want to see the “customerproject” id and the lead.”firstName” and lead.”lastName”

    form.yml

    search.yml

    But I can only see name or id field. firstName, lastName, leadName or whatever I tried to do doesn’t work.

    Thank you for your time

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #34030

    Sergey
    Participant

    Hi, @cardiac

    Please check your entities and config first.

    many to one relation from your entity side should have singular name – lead or should be one to many.

    And you can use property path for field configuration, like

    #34031

    cardiac
    Participant

    Thanks. The relation was wrong. And the property path is a nice solution.

    Here’s the code for the community:

    CustomerProject Entity:

    #34032

    cardiac
    Participant

    Update:
    Got an error when creating a CustomerProject:

    The field “firstName” specified as “one-to-many” relation for entity “app_customerproject” is not a collection.

    Solution:
    Firstname and lastname field not needed in search.yml

Viewing 3 replies - 1 through 3 (of 3 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top