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
Vladimir BessonovVladimir Bessonov 

find record by record id in lookup field?

how to search with record id in lookup field? 
it is wastful to create extra field for the name and have auto enumaration for name 

I found an option to change search layout - add some other field there, but it still looks only for name ? is there any workaround? to me Record is explicit enough to find the record. 
Suraj Tripathi 47Suraj Tripathi 47

Hi Vladimir,

Your requirement is not clear . Please give us detail requirement.

1. Are you talking about record id or record type id.

2.Are you getting record id from VF page or Aura component.

Please share an simple Example of your requirement.

Thank you

Vladimir BessonovVladimir Bessonov
Lighting Page.  
I have Lookup field. 
I need to select an record for this lookup field. 
I have many objects with the same name. they have some other fields that makes them different and one field is unique - Record ID. 

When you search the record in lookup field - it searchs only record name. I wanted to use record id for that. 

It shall be clear now. 
Yogendra JangidYogendra Jangid
Hi Vladimir,,
Searching with record id on standard lookup is not allowed. You may have to design a custom solution to get through your requirement.
Alternatively you can add more fields on search layout to mark your designated record. Then search for all records under lookup dropdown and look out for your record.
https://help.salesforce.com/articleView?id=sf.customize_searchlayout.htm&type=5 (https://help.salesforce.com/articleView?id=sf.customize_searchlayout.htm&type=5" target="_blank)
https://help.salesforce.com/articleView?id=sf.search_enhanced_lookup_specify_filters.htm&type=5 (https://help.salesforce.com/articleView?id=sf.search_enhanced_lookup_specify_filters.htm&type=5" target="_blank)
Also to your question, one lookup can only be linked with one object unless the lookup is customized lookup. So having same name for many objects here doesn't matter.
Vladimir BessonovVladimir Bessonov
I can change search layout, but it doesnt enable me to enter several search creteria in lookup field. 
It still looks only for record name. 
Yogendra JangidYogendra Jangid
Yes Vladimir, search is only on Name field and there is no way to change that in standard look. What I am trying to say is that you can click on "Show All Result for" as shown below
User-added image
then you will get the more detailed view of lookup result like below
User-added image
and this will have all your search layout fields so you can choose from the available options. But yes there is no option to search with ID as you are trying with standard lookup. 
Still if you wish to search with your own field, consider customizing your lookup by creating custom lookup for search. This is not OOB salesforce feature and need to code to achieve this.
Hope this answers your question.