In my requirement I have a junction object between Account and Contact. Now there is a requirement that on the case object, where standard lookup field of contact and account are present, when I have populated a contact in the field and click on the lookup icon of the account field, the lookup dialog should show all the accounts that are related to that contact via the junction object. How do I achieve this? LEt me demonstrate using an example:
For eg. There is a contact 'Contact1' which is related to 'Account1', 'Account3' and 'Account4' via the junction object records. On the case object, in the contact lookup, I selected 'COntact1'. Now when I go the account lookup and click on that magnifying glass, the dialog that opens should show only 'Accouont1','Account3' and 'Account4' in the results.
Kindly help guys. I'm stuck!