+ 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:inputField value="{!Contact.AccountId}"/>

Hope this helps.

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
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.