Many to Many Relationships with Standard Objects

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Trying to create a table which contains data from the Task object, Opportunity, Contact and Account. I want to capture the tasks that have been created against the opportunity, but obtain the email addresses that are located on the contact's object. The contact object is related to the Account object. I have managed to only use the Task object  but missing the connection to the Contacts to obtain more data, especially the email addresses. 

This diagram illustrates a simple flow of how our data is structured. 

Any tips on how I can get the emails from the contact object on my table would be great. I'm also trying to avoid placing the data in a drawer. 

Thanks again!
Photo of ns

ns

  • 1,822 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
There could be multiple emails addresses since there could be multiple contacts. Or is there something on the Task, Opp or Account that specifies a particular Contact?
(Edited)
Photo of ns

ns

  • 1,822 Points 1k badge 2x thumb
Yes there is. A custom field on the Account called: Partners__c

There is Lookup filter on the Contact object for Partners__c

The Opportunity has a formula text field that comes from the Account, Partners__c

There are also, 2 checkboxes that help filter a task and opportunity: Position__c
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Sorry. This is very hard to follow. Looks as though you can isolate the email address by using a UI only formula field with the MODEL_LOOKUP function.

MODEL_LOOKUP(Lookup_Model_Id,Model_Field_To_Return,Model_Field_To_Search,Search_Value)
Photo of ns

ns

  • 1,822 Points 1k badge 2x thumb
Yeah maybe I overcomplicated it :)

I'll test your recommendation and let you know.

Thank you!