0

Is it possible to filter out only contact related to an account in a case object. When a case is created from account, it has the account field in case populated with the account name/Id. I want to select contact and the lookup should only show contacts related to this account. Is this possible?

Thanks

Update: Screenshot of what i have, i also tried the other way around, Contact Name:Account Name : AccountId equals Case:account Name: ID. In both cases i cant find the contacts which are related to the account set in the account. if i click show all results and then search i do get the contacts but its not when the filter is on. enter image description here

3
  • Are you using a Visual Force page or the standard Salesforce form? Commented Jan 22, 2013 at 8:49
  • using a VF page
    – Prady
    Commented Jan 22, 2013 at 11:31
  • 1
    In that case take a look at this post: blog.jeffdouglas.com/2011/08/12/… it describes how you can override the 'regular' lookup. I've used this in a system I'm working on and it's really great. Especially if you also use jQuery to autocomplete your contact input field. Commented Jan 22, 2013 at 11:34

2 Answers 2

6

enter image description here

The lookup filter can be set to achieve this requirement

3
  • I am not able to get it working.. updated the question with the screenshot of what i got
    – Prady
    Commented Jan 23, 2013 at 6:11
  • @Prady The question was tagged with admin so had not thought of using visualforce .This answer was for out of box .For visualforce may be you may need what Lex is suggesting.Thanks for heads up Commented Jan 23, 2013 at 7:05
  • i really didnt want to implement a own lookup Vf page unless very necessary. If filter could do it i am happy.. But some how filter doesnt seem to work
    – Prady
    Commented Jan 23, 2013 at 10:55
0

As I already posted in my comment; take a look at this article. It gives you a way to implement your own lookup page. It basically consist of overwriting the JS that opens the popup and implementing your own visualforce page for the lookup. In our project I've combined this with the jQuery Autocomplete plugin that gives you possible options if you start typing in the field.

If you have more technical problems, leave a comment and I can give some more details.

3
  • Thanks @Lex, i was thinking on having a custom lookup Vf page if its really necessary. If a out of box solution could do it i would prefer it. If nothing works then custom Vf page :)
    – Prady
    Commented Jan 23, 2013 at 10:55
  • Actually, if you use an apex:inputField on your VF page, it will also be subject to the lookup filter, so Mohith's answer could still be possible. In the screenshot you posted everything seems to be ok. What problems are you experiencing? Commented Jan 23, 2013 at 10:59
  • its not showing contacts associated with the account selected. If i remove the filter out i can view the contacts associated. Would filter work on a new record? i am selecting account first then selecting contact.
    – Prady
    Commented Jan 23, 2013 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .