• #61504

    How we can create lookup fields in Visualforce pages in salesforce ??

    How we can create lookup fields in VF pages ??

    Salesforce | Prachi Prachi #2


    Lets take an Example:
    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.
    In your Controller do the following,
    public Employee__c getFirstName()
    return [select FirstName__c from Employee__c limit 1];
    Now, In your Visualforce page do the following.
    <apex:inputField value=”{!firstName.FirstName__c}”/>

    where firstName is the method name in the Controller.

    By doing this a lookup icon will be rendered on ur Visualforce page.


    • This reply was modified 5 months ago by Salesforce | Prachi Prachi.
Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?