In my company, we have Accounts and Customer Numbers, where an Account can be a company name, like Amazon, and it can contain multiple Customer Numbers (e.g. AMA001) through a Master-Detail relationship. I am trying to set up a lookup field in the Opportunity object that would search for Customer Numbers, but would also return results based on the Account Name that is the master of that Customer Number.
So, for instance, if a rep is searching for "amaz" in the field, it would return the results based on Account Name, so all of the Amazon-related Customer Numbers would show up. Similarly, if a rep wants to search for "AMA001", it would find that exact match in the Customer Numbers. I managed to get some results with field filtering, but it stops matching to Account Names after 4 characters, after that it starts to prioritize addresses and descriptions for some reason. So, it works with "Amaz", but once you type "Amazo" it goes nuts and gives me semi-random Accounts. Thank you all for your help!
Unfortunately, This is not possible as lookup is the reference field and when you click on "Name" from the lookup dialog then in backend it returns the ID of the record.