I want to create a VF page where I can render a lookup field to profile.
This is what I have done till now. AdminController is my Custom Controller
public with sharing class AdminController{
public User user1 {get;set;}
public AdminController(){
user1=new User();
}
}
Now in VF page
<apex:inputField value="{!user1.Profile}" />
But I am getting Error :
Expression value does not resolve to a field Error is in expression
'{!user1.Profile}' in component in page
Best Answer
Unfortunately for the profile you wont be able access as a lookup as we all know there is no such field in salesforce thats lookup to profile
The alternative solution could be to roll your own custom lookup window as shown in below blog
http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/
OR just think of a new window open in javascript and pass the value from child window to the parent window .
Code for the child window(PageOpener) and script for the communication from child to parent window
The above code should get you started and help you on how to send values between parent and child windows.