Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Cross-company queries where linked table records are in different companies

Posted on by 280
Hi all
Running AX 2012 R3 CU9. Couldn't find any documentation on this subject
This is my situation:
Our AX environment has two legal entities - I'll call them LEA and LEB for this example.

We often create purchase orders in LEA which automatically create sales orders in LEB. In order to report on this, we've been using an external database connection to our SQL Server - however I'm trying to consolidate this report onto an AX SSRS report.
Created an example cross-company query. I can be in LEA and run an SSRS report which uses this query, and return SalesTable and SalesLine records in LEB.
However, when I try to link with PurchLine (PurchLine.PurchId == SalesLine.PurchOrderFormNum) (PurchLine.LineNumber == SalesLine.LineNum) - it doesn't return any values. To repeat, this link definitely works both in external databases, and in the SQL Server instance on the server running the SQL service for the environment.

When I change the query link to OuterJoin, it still returns all the SalesLine records as expected, but with no PurchLine attached. From this I've taken to mean that it can't see the associated record even though it's there in the other company. I've also tried running this from both companies with the same results.
Is this a known issue, and is there a workaround? Or am I missing something?
Thanks very much in advance for your help
Cheers
Luke

*This post is locked for comments

  • lukbel Profile Picture
    lukbel 280 on at
    RE: Cross-company queries where linked table records are in different companies

    Hi Crispin

    Is this the official workaround? I'm still confused as to what causes the method I described to not work in this fairly common use case

    Also, if this is legitimately the only way I may need some more info - what do you mean by "takes ranges (instead of join)". A range filters a recordset and a join links two recordsets together, right?

    Why do temptables work but not, for example, a view?

    I only ask because, while it's solely for an SSRS report now, it's expected in the next year we'll need it to feed Enterprise Portal reports. If you're describing an RDP-type solution, this may not be suited for that.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans