+ 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}" />

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
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