I am developing a Visualforce Page and I want to render a lookup field in the same page.
So, I am attaching the page to my Custom Controller (Say AdminController) and I want to create a lookup field to User object.
I am new to salesforce, so any kind of help would be appreciated.
I have written my custom Controller
public class AdminController{
public User usr {get;set;}
// creating dummy method
public String getUser() {
return null;
}
public AdminController()
{
usr= new User();
}
}
And in my Visualfolce Page I have entered
<apex:inputField value="{!usr.id}" />
Best Answer
The below is how your visualforce tag should be
Please note i dont know your API names of object and field so you need to make sure to replace with exact names