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
Hariom Chaudhary 1Hariom Chaudhary 1 

How to make a dyanamic lookup field in visualforce page ??

Krishna SambarajuKrishna Sambaraju
Hi Hariom,

For example, your visualforce page is based on Contact object and you want to have a lookup field to Account then you can do as below.
<apex:form>
      <apex:inputField value="{!Contact.AccountId}"/>
</apex:form>

Hope this helps.

Regards,
Krishna.
Deepali KulshresthaDeepali Kulshrestha
Hi Hariom,
Please see the given below link with the help of this, you can solve your problem, it may be helpful to you.

Let's take an example: 

In below link you will find the example which is same as your question:
Link: https://developer.salesforce.com/forums/?id=906F000000094YKIAY

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com
Hariom Chaudhary 1Hariom Chaudhary 1
User-added image
Like in this lookup is there but this is standard, i want dyanamic like i can search all accounts in account section and there should be a new button to create a new account.