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.
- salesforce.stackexchange.com/questions/7494/… You may like to refer this linkMohith Shrivastava– Mohith Shrivastava ♦2013-02-07 07:21:38 +00:00Commented 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 pageAnuRaj– AnuRaj2013-02-07 07:46:58 +00:00Commented Feb 7, 2013 at 7:46
Add a comment |
2 Answers
You can accomplish this using the Filtered Lookup feature.
- 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.AnuRaj– AnuRaj2013-02-07 07:46:04 +00:00Commented Feb 7, 2013 at 7:46
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
- 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 pageAnuRaj– AnuRaj2013-02-07 08:21:32 +00:00Commented 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 filters2013-02-07 08:23:28 +00:00Commented Feb 7, 2013 at 8:23