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
King KooKing Koo 

Can I return some other fields other than the Name field with Lookup Icon?

Hi guys


I just want to make sure I understand there is no way around it except using VisualForce.


I have an Employee object, with a field for First Name, a field for Last Name, a field for Middle Name.  And then I have the standard Name field (which I renamed to Employee Id) which is an auto-generated number.  (I wish to use the standard Name field to store the employee names but standard Name field is at most only 80 characters long, which can sometimes present challenges for names.)


I have some other objects that have lookup to Employee.  In those edit forms, when I click the lookup icon, the lookup screen displays Employee Id.  I know I can tailor the page so it'll also show Last Name, First Name, Middle Name.  But I can only choose the employee by clicking the Employee Id, and when the lookup icon closes, it is the Employee Id that is displayed in the original form (from which the lookup window is called).  


1. Is there any way that, instead of showing Employee Id, that I show the Employee Name (which is a formula field in the Employee object)? (without using Visualforce that is)


2. I really was hoping I could make the Employee object to work like the standard Contact object, so that when you're in the edit form, the name is split into FIrst Name/Last Name fields, but when you display the Employee record in detail form it shows as one field.  Has anyone successfully implemented an Employee object like a Contact object?




Best Answer chosen by Admin (Salesforce Developers) 
Santhosh KumarSanthosh Kumar

I don't think it is possible to display custom field value in place of standard Name field in the reference fields display. See the response in another similar question.


Salesforce has lots of inbuilt logic with many standard things in the system and so showing First Last name of a contact is one of them. It is not possible to achieve the same functionality without writing some custom code to keep the data synced as and when changes happen.