web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

Advanced Find based on three Entities

(0) ShareShare
ReportReport
Posted on by 470

Hi,

I would like to perform the following results from a query either in CRM or SQL directly

Select all the Active Contacts (Contact ENTITY) email addresses from active Accounts (Account ENTITY)   excluding a country that do not have a contract (Contract ENTITY)

so results should be similar to

Company 1      Contact 1 email address
                        Contact 2 email address

Company 2      Contact 3 email address

Company 3      Contact 4 email address
                        Contact 5 email address

How can this easily be achieved.

Any help is greatly appreciated.

I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    According to your description, there are some questions.

    1.Which the main entity do you want to query for? Leads or Contact?

    2.In OOB D365, Lead has no relationship with contract, and there is no such entity named "country", so did you add custom entity and create relationship between contract and "country"?

    3.Lead could be qualified to account and contact, so what's the relationship between the contact, account and lead in your case?

    Could you kindly share more information and your scene so that we could help you better?

    Regards,

    Leo

  • nickmangioros Profile Picture
    470 on at

    Thanks for your quick reply

    My answers to your 1questions:

    # 1.  The main Entity I want is Contacts

    # 2 . Account has a relationship with Contract

           Contact has a relation ship with Account

          Country was not an entity, it is a field in the Accounts entity  (Country/Region)

    # 3,  I am not working with Leads, only contacts.

           Hope this clarifies.

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 61 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 31 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans