You need to sign in to do that
Don't have an account?
Jens Peter Kristensen
User lookup input field
Hi
I have a visualforce page with a apex controller connected. There is no connection / lookup to the user object.
On that page I need a <apex:inputField that has a standard lookup to the user object.
Right now my include field is not shown because I don't have it connected to a user object.
Can someone tell me how to do this ?
Maybe it needs to be solved by creating a dummy field that has that lookup but I fail it getting it to work.
If somebody could help what is needed in the vfp and in the apex controller that would be great.
I tried to create a brand new vfp and apex controller to get a better understanding of the problem :
Vfp :
<apex:page controller="JpkTestController">
<apex:form id="form">
<apex:pageBlock title="View as" id="viewAs">
<apex:pageBlockSection >
<apex:inputField id="TestUser" value="{!user1.Id}" required="false"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Apx controller :
public class JpkTestController {
public User user1 {get;set;}
public JpkTestController() {
user1= new User();
}
}
I have a visualforce page with a apex controller connected. There is no connection / lookup to the user object.
On that page I need a <apex:inputField that has a standard lookup to the user object.
Right now my include field is not shown because I don't have it connected to a user object.
Can someone tell me how to do this ?
Maybe it needs to be solved by creating a dummy field that has that lookup but I fail it getting it to work.
If somebody could help what is needed in the vfp and in the apex controller that would be great.
I tried to create a brand new vfp and apex controller to get a better understanding of the problem :
Vfp :
<apex:page controller="JpkTestController">
<apex:form id="form">
<apex:pageBlock title="View as" id="viewAs">
<apex:pageBlockSection >
<apex:inputField id="TestUser" value="{!user1.Id}" required="false"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Apx controller :
public class JpkTestController {
public User user1 {get;set;}
public JpkTestController() {
user1= new User();
}
}
You can use lookup field to user object on any object. And do something like this:
I tried that and unfortunately it doesn't show my input field it only shows the label. Do you know why ?
Somebody told me it is because there was no relation to the user - but I don't understand what is missing
Thanks a lot