2

I have a contact lookup so when i click on the lookup it opens a popup and i search for a particular contact. what i want is to restrict the result to display only contacts related to a account, for example in my case object i have account field i also have contact field when i click on the lookup of contact it should only show the contacts of the account. Do any body have any idea to do this. Please help me.

2
  • salesforce.stackexchange.com/questions/7494/… You may like to refer this link Commented Feb 7, 2013 at 7:21
  • thanks that was nice but works only when we insert record through the object directly. Can you guide me how to do it through code. because i am trying to insert record from a VF page Commented Feb 7, 2013 at 7:46

2 Answers 2

4

You can accomplish this using the Filtered Lookup feature.

Defining Lookup Filters

1
  • thanks that was nice but works only when we insert record through the object directly. Can you guide me how to do it through code. because i am trying to insert record from a VF page. Commented Feb 7, 2013 at 7:46
1

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

If you are using visualforce page for this one workaround is to roll your own salesforce lookup popup window .

The above blog has tips and tricks on how to achieve this

2
  • is the filters only work on a standard page, if we are using the field as apex:inputfield wouldnt the filter work like in standard page Commented Feb 7, 2013 at 8:21
  • Filters i personally have tried but with no luck.You can try though .Sometimes i used to get field "filter Validation Exception".let me also know if you are able to work for visualforce with filters Commented Feb 7, 2013 at 8:23

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.