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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

select crossCompany not working properly

(3) ShareShare
ReportReport
Posted on by 150
I have two customers that share the same party but in different legal entities

in each legal entity, i created one contact for this customer

So:
Customer1 partyNumber1 USMF
has 
contactPersonX partyNumberX USMF
 
And
Customer2 partyNumber1 USRT
has 
contactPersonY partyNumberY USRT

Why this while select below is returning both customers (1 and 2), even though only customer1 has contactPersonX?
i know "1234" is the same for both, but contactPersonId is not shared between them, so shouldn't it only enter the while loop once instead of twice?

  while select crosscompany custTable
      where custTable.Party == 1234
  join contactPerson where contactPerson.ContactPersonId == "contactPersonX"
{
}
Categories:
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,769 Most Valuable Professional on at
    It's not a problem of crossCompany. You forgot to specify a join condition between custTable and contactPerson, therefore you're getting a Cartesian product.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,779 Super User 2026 Season 1 on at
     
    You need to add the relation between CustTable and ContactPerson.
    CustTable.ContactPersonId == ContactPerson.ContactPersonId
    BR,
  • Waed Ayyad Profile Picture
    9,066 Super User 2026 Season 1 on at

    Hi, 

    Is your issue resolved? If yes, mark the answers that helped you as verified. 

    Thanks,

    Waed Ayyad

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 509 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 375

#3
Adis Profile Picture

Adis 268 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans