function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Antonio Jesús Criado ManzanequeAntonio Jesús Criado Manzaneque 

Visualforce Page - Search field to pick an Account

Hi, I'm trying to print a search field on a Visualforce Page that allows the user to choose any account he wants. Something like that:

http://salesforce.stackexchange.com/questions/66583/create-visualforce-input-that-uses-lookup-popup
User-added image

The problem is that I could not see all the accounts because I'm reusing a Contact field (AccountId). Does anyone know any way to print a input/search field that could allow me to do this? Thank you all!
GarryPGarryP
one way to do this could be just use a StandardController as contact sobject and the URl of page SHOULD NOT HAVE any id
and push all your logic for the page to extension controller

use {!Contact.AccountId} in inputField tag and you should see all the accounts.

<pre>
        <apex:inputField id="account" value="{!Contact.Accountid}"  required="false" />    
</pre>