You can use inputfield to map lookup field in vf page <apex:page standardController="Contact"> <apex:inputField value="{!contact.account}"/> </apex:page>
You can use inputfield to map lookup field in vf page <apex:page standardController="Contact"> <apex:inputField value="{!contact.account}"/> </apex:page>
Suppose you have an Employee Custom Object. In that lets say you have First Name Custom field. Now you want the lookup icon to be displayed for the above field in your Visualforce page.
Controller
public Employee__c getExample() { return [select FirstName__c from Employee__c limit 1]; }
You can use inputfield to map lookup field in vf page
<apex:page standardController="Contact">
<apex:inputField value="{!contact.account}"/>
</apex:page>
Hope this helps :)
All Answers
You can use inputfield to map lookup field in vf page
<apex:page standardController="Contact">
<apex:inputField value="{!contact.account}"/>
</apex:page>
Hope this helps :)
how to achieve the same in custom controller....?
Suppose you have an Employee Custom Object. In that lets say you have First Name Custom field.
Now you want the lookup icon to be displayed for the above field in your Visualforce page.
Controller
public Employee__c getExample()
{
return [select FirstName__c from Employee__c limit 1];
}
Visualforce Page:
<apex:inputField value="{!Example.FirstName__c}"/>
if this answer helps,please mark it as best answer to help others:)
Thanks,