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
Jeff McJeff Mc 

Lookup popup with no parent object

I've been asked to create a wizard where the first page allows the users to select an account name.  They would like to see the Account Name input field with the lookup button so they can either type in the account name or search.  My problem is that it seems that the lookup icon only appears when the field is a lookup field of some parent object, e.g. Opportunity.AccountId or Contact.AccountId.  Is there something basic that I am missing (I'm new to SF) or is there a better way to do this that I could suggest to the users?
You are correct.  They way I usually handle this is to have a "carrier" object, for the sole purpose of making a lookup field available.  Thus in your case I would probably use another account, as that has the parent account lookup on it.  You'll need to use an extension or custom controller and instantiate an account in the constructor.  You can then put an input field on the page bound to the parent account lookup.  When the user submits the form to move to the next page etc, the chosen account will be populated in your controller specific account and you can do whatever you need to with it. Just remember never save the carrier.