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
SFDHSFDH 

custom lookup field for contacts in visualforce ?

hi...

 

 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 - sfdh1026@gmail.com

skype - sfdh1026

Sonam_SFDCSonam_SFDC

Hi SFDH,

 

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

http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/

 

Worth a read!

SFDHSFDH

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

 

How to Create a Lookup field for Contacts ?

VennilaVennila

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