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

custom lookup field for contacts in visualforce ?



 I want to Create a Custom Lookup field for Account and fo Contact ,

  • After Selecting Account from 1st lookup field ,
  • when i click the 2nd lookup field for Selecting Contact it should display those contacts only related to the Account Selected .
  • if No account is being selected it should display all the Contacts ..

how to write Visualforce and controller for this ?


please help ..


email -

skype - sfdh1026




The following blog talks about creating lookup filters for account and contact on  visualforce page and there is some helpful code as well:


Worth a read!


Thnks for ur Rply ... but I didnt got my ans thr ,


How to Create a Lookup field for Contacts ?


Hi. you can use Lookup Filter instead of using Visualforce page and Apex controller.