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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
KristineRisberg Profile Picture

KristineRisberg 37

#2
11manish Profile Picture

11manish 35

#3
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 21 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans