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
bharath kumar 52bharath kumar 52 

Lookup filters to display contacts belonging to a particular account

Hi All, 

I am stuck with a requirement where i have "Objectx__c" which is a child to case and i have field on this object which is a lookup to user. 

The requirement is that when the lookup dialog(in objectx) pops up i should be able to view only those users/contacts belonging to a particular account.

Ex : If my case has "Account abc" i should be able to view contacts/users belonging only to  "Account abc" in  lookup and not "Account xyz".

Please tell me how to achieve this through standard functionality. And what can i use to make this work.

Note : I cannot hardcode any accountid here.

Requesting fellow developers to help me on this.

AndyuxAndyux
I have the same question w w child to opportunity, you can follow here
https://developer.salesforce.com/forums?state=id#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Developer_Forums&criteria=OPENQUESTIONS&id=906F0000000BaGOIA0
bharath kumar 52bharath kumar 52
@Andyux Thanks, im following the thread. Meanwhile, it thought that we may have to use a custom lookup vf page to achieve this as this isn't possible with the standard functionality. Another thing that we can do is vote for an idea(if it exists) so that Salesforce may roll out this in feature in the future.
AndyuxAndyux
Install "Lookup Helper" app
Add an account lookup field (AccountLU) to your custom object, dont add it to any page layouts.
Setup "Lookup Helper" app to get AccountLU value populated from the opportunity - AccountID
Add this Account lookup to contact lookup filter:
  Contact1: Account: Account ID FIELD = yourobject: AccountLU 
 
bharath kumar 52bharath kumar 52

Thanks Andy. I tried using URL hacking but that didn't work in my favour.