Link Field displays unrelevant option in Search Field

Hi,

We have created a custom doctype called Employee Details and the record is being saved in a specific ID when saved (ENS###), let’s remember it as id1.

Since id1 is saved in an incremental manner, it is like ENS001, ENS002, etc.

Now, it seems like id1 is wrongly mapped to some employees, so we are asked to revamp those id1 for all employees, but since many of those id1’s are mapped to Lead, Prospect and Customer doctypes, it is impossible to delete all records and correct those id1’s.

So I have created a new field, let’s remember it as id2… So, if I want to create a new employee or update id2 for an existing employee, it is getting saved in the backend as an incremental id1, but id2 is what is shown in the frontend as the saved record.

Here is the problem:

In Lead doctype, there is a field linked to Employee Details… When I click that, the suggestions are as follows:

Now, I do not want to display the id1 at the bottom, since it might create a confusion for the users.


Where the id shown in the title field is the id2 and in the bottom it displays id1(need to remove that) & full_name…

I have been trying to find a solution for this issue, but couldn’t find anything… Your response and solution is greatly appreciated… Thank you!