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
bujjibujji 

Show User Lookup in VF page

Hi Guys,

I am trying to show the user lookup in VF page. Unfortunately i am not able to as it showing any lookup icon. Below is my controller code and vf code.
How to show Lookup Icon, so that user can select the user.

* All fields are showing lookup except the Id

public User usr {get;set;}

<apex:outputLabel >User Lookup: </apex:outputLabel>
<apex:inputField value="{!usr.Id}"/>

Thanks,
Bujji
Virendra ChouhanVirendra Chouhan
Hi Bujji,

Is there relationship between your object and user Sobject?

if no then Create a lookUp relationship and use
<apex:inputField value="{!account.User__c}"/>
replace account with your object .

Regards
Viru
bujjibujji
Ok even though, it is not working see the code which i have written.

Controller code
----------------------
public AccountTeamMember atm {get;set;}

vf page code
-----------------

<apex:outputLabel >User Lookup: </apex:outputLabel>
           <apex:inputField value="{!atm.UserId}"/>


Thanks,
Bujji
Virendra ChouhanVirendra Chouhan
Are you created lookup filed with name UserId?

if yes then use '__C' because it is custom filed.

like
<apex:inputField value="{!atm.User__c}"/>


bujjibujji
'UserId' is a standard field of AccountTeamMember Standard Object, i want to give the user to select user.

Thanks,
Bujji.