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, ...
Answered

Getting error after adding ranges in Data entity

(1) ShareShare
ReportReport
Posted on by 17
Hi All,
I have the requirement to expose a data entity that will return all the customers with zero sales order.

I've first run the sql query and then converted it into the data entity range, below is the query and screenshot of the entity and also below is the error I am getting.

SELECT c.ACCOUNTNUM
FROM CUSTTABLE c
LEFT OUTER JOIN SALESTABLE s ON c.ACCOUNTNUM = s.CUSTACCOUNT
WHERE s.CUSTACCOUNT IS NULL
GROUP BY c.ACCOUNTNUM
 


 
 
 
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,634 Most Valuable Professional on at
    The approach looks strange to me. If you used inner join, you'll filter out everything. If you used outer join, you'll still get all customers. It's not the same as your SQL code.
     
    Do you need a special entity returning just customers without orders? Another approach would be providing the number of orders (computed columns) and using an OData filter to get just customers without orders. If you need a special entity, consider creating a view returning CustAccount and HasOrder, using it as a data source instead of SalesTable and applying a range there.
     
    (Moved from Dynamics AX forum.)
  • Verified answer
    MK-27040851-0 Profile Picture
    17 on at
    I've created a view that is returning customers without SO and then join it with custtable within entity and that worked.
    Thank you so much for your reply and solution.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 797

#2
André Arnaud de Calavon Profile Picture

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

#3
Subra Profile Picture

Subra 534

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans