+ Start a Discussion
Scott0987Scott0987 

display different field then the name with a lookup

So what I have is an object that has a lookup field.  On my visualforce page I have an inputfield that is linked to the lookup field.  I need to have the lookup button on it so that the user can change the record that it is connected to, but I don't want to display the name on the field.  I would like to display a different field from the lookup object.  Is there a way to do that? 

Shailesh DeshpandeShailesh Deshpande
I am not sure if I have understood your question properly. If your question is that you want to displaly a different label for the lookup field instead on what it actually shows then you need to check this :

if you have wrapped your inputfield inside a pageblocksection, you cant remove the label of your field. To do so, you need to remove the pageblocksection.

if your question is that when user clicks on the lookup icon, the set of fields that appear on the lookup dialog have to be changed, then you can go to setup -> create - > object -> your object -> lookup dialog - > add the fields that you wish to see