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
Rahul_MishraRahul_Mishra 

How To Add Values To Lookup Filed According to Object Selection

Hi,
I am Creating a visualforce page in which I have apex selectlist which contains the type of objects which should be selected by lookup field and show results accordingly.Below is the screenshot
User-added image
I want lookup field to show values according to the value selected in selectlist.If I select Account then lookup field should show the Accounts in lookup field and vice versa.
Plz help in coding this in apex controller

 
SinghforceSinghforce
Hi Rahul,

You can do via rerendering the lookup field based on the selection. You need to use 2 lookup fields for this and render it based on the user selection.

Thanks,