• #61504
    Forcetalks

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

    How we can create lookup fields in VF pages ??

    #61508
    Salesforce | Prachi Prachi #7
    Forcetalks

    Hi,

    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.

    Thanks.

    • This reply was modified 3 weeks, 3 days ago by Salesforce | Prachi Prachi.
Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

Popular Salesforce Blogs

CONTACT US

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

Sending

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 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?