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
Dave MedlicottDave Medlicott 

How to not display 'Role' when doing a User lookup on VF page

I have a custom object that has a field that is a lookup to a User. When I put that on a VF page, I get a picklist for the UserRole (Public, Partner User) and the lookup for the name. I'd like to force it to always be for the User and not the partner user. I've tried various things that have no effect. Here's the page:

<apex:page Controller="testController" sidebar="false">
<apex:form >
            <apex:inputField value="{!userName.User__c}" />
</apex:form>
</apex:page>

And the controller:
 
public class testController {

    public test__c userName{get;set;
    public testController() {
        userName=new test__c();
    }
}

If anyone knows how to limit this so onlty the User role is searched and the Role picklist is not displayed, I'd appreciate it.

Thanks, Dave
olegforceolegforce
If this is the picklist you are referring to, then the only way to get rid of it is to either create your own lookup page or by using jQuery or something similar to traverse the DOM and hide this element.... 

User-added image


- olegforce