function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jayakrishnan SalimJayakrishnan Salim 

Secondary fields not searchable in lookup in custom objects

In my org, I have a custom object whose Name field is an auto-number field and has another field which is a lookup to contact object. In the contact object I have a lookup relationship to this custom object. Since the name field is an auto-number field, the secondary field should be searchable in instant results as per this document (https://help.salesforce.com/articleView?id=search_lookup_config_lex.htm&type=5). In the search layout of the custom object, I have configured it as the contact field as the secondary field. 
User-added image

As you can see in the above screenshot, the secondary field in the search layout is the lookup to contact. So as per the Salesforce documentation, I should be able to search the custom object records with the contact names in instant results. But instead, I am not getting any results. Is there any other configuration I am missing? Could someone guide me please?
Best Answer chosen by Jayakrishnan Salim
Jayakrishnan SalimJayakrishnan Salim
Hi Shirisha, 

Thank you for the response. Yes, I checked. The secondary fields are searchable but not lookup searchable. In lookup searches, only texts and numbers are searchable. So in my case, I created a custom text field in my custom object and made it as the secondary field in search layout. I created a process builder to populate this text field with contact name at the time of record update. Now it is working. I hope this work around will help others in the future. 

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Jayakrishnan,

Greetings!

Yes,as per the document the second field should be searchable if the first field is an auto number.So,can you please try by using some other field instead of using the Contact(lookup field) in the second order to troubleshoot further on this.

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Jayakrishnan SalimJayakrishnan Salim
Hi Shirisha, 

Thank you for the response. Yes, I checked. The secondary fields are searchable but not lookup searchable. In lookup searches, only texts and numbers are searchable. So in my case, I created a custom text field in my custom object and made it as the secondary field in search layout. I created a process builder to populate this text field with contact name at the time of record update. Now it is working. I hope this work around will help others in the future. 
This was selected as the best answer
Latha T. DavuluriLatha T. Davuluri
Hi Jayakrishnan,

I have the similar issue, however it still doesn't work with the work-around provided by you. Can you please confirm if this solution works only in Classic and not in Lightning?

Thanks,
Latha
Jayakrishnan SalimJayakrishnan Salim
Hi Latha,

I tried that solution in lightning, not in classic. It worked for me.
Latha T. DavuluriLatha T. Davuluri
Hi Jayakrishnan,

Thanks for the confirmation.