Search Component - lookup field

Tami LustTami Lust Member
edited February 4 in Questions
I added a lookup relationship field to the template of the search component but it doesn't seem to be searching the lookup field values. Is this not possible?

For example: Using only the Contact object in the search I want to also search for Accounts. I add the Account field from the contact record but no results appear when searching for an account name.


Comments

  • edited October 2019
    The relationship field I think is a reference to the record Id, not the name, so you would have to use the account name field instead of the reference field.
  • Tami LustTami Lust Member
    edited August 2017
    Hi Raymond,

    I am using Account__r.Name and the name shows in the template. If I just search by the Account name it doesn't yield any results.

  • edited October 2019
    I can't explain why it is happening but a quick work around would be to add a salesforce formula file on the contacts object that returns the account name, the add that field to your search
  • Tami LustTami Lust Member
    edited August 2017
    Hey Raymond,

    I thought that would work also but it doesn't. If I search for the Account name through the Contact object it returns no results.
  • Mark DeSimoneMark DeSimone Skuid Mod 🛠️ 
    edited February 4
    Hi Tami, the search component would need to have a return object set up for each of the objects that you'd like to search through. Is there something specific to your use case that prevents you from adding Account as a return object?
  • edited October 2019
    Depending on use case, you may only need one return object. For example, if yo wanted all the records from all the objects related to contacts to filter by a specific contact, then you could have contacts be the return object and the set the conditions on each model equal to the contact Id. Then you could filter multiple models/objects by the record Id from a single return object..
Sign In or Register to comment.