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
stpetecrmstpetecrm 

Lookup in a wizard page

I would like to have a lookup field instead of a text box on my opportunity wizard.
 
What control should be used to lookup vs. inputText?
 
Thanks
Steve ChadbournSteve Chadbourn

As long as the inputField control points to a lookup field, a lookup field will appear on your wizard.

I do the same thing myself on my case wizard.

stpetecrmstpetecrm
I've got the following so far connected to a custom controller that calls getAccount

<apex:pageblocksection title="Account Information">
<apex:inputField id="accountName" value="{!account.name}" required="true"/>
<apex:inputField id="accountSite" value="{!account.site}"/>
</apex:pageblocksection>

Thanks for your help.
Steve ChadbournSteve Chadbourn

And does it work?

I would point the inputField to new_opportunity.Account

PeterUchytil.ax224PeterUchytil.ax224
I must be missing something very fundamental. I cannot seem to get the fieldInput controls to render lookup controls. What I want is to have a blank Account lookup field (the one with the magnifying glass) on the Visualforce page so the user can associate the new custom object with an Account.

I have a custom object with a lookup field bound to Account.

I have this custom controller:

public class NewProtoshare {
    public Account account;
    public Account getAccount() { return account; }
    public void setAccount(Account value) { this.account = value; }
    ...
}

And this call on the page:

           <p>ACCOUNT: <apex:inputField id="accountName" value="{!account.name}" /></p>

And I get this error when I pull up the page:

          Could not resolve the entity from &lt;apex:inputField&gt; value binding '{!account.name}'

Any ideas? From other postings it seems like this is something that should work. Thanks for any direction you can give.

Peter