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 forum

Debugging a Query

(0) ShareShare
ReportReport
Posted on by

I am trying to debug a query which doesnt return any results on D365.  When i take sql value from query object using breakpoint and run on outside of D365, It does return results.( with necessary changes to make it compatible to SQL server)

Am i missing anything here ?

Query.jpg

  • Suggested answer
    Ajit Profile Picture
    8,788 on at

    Sql query returns data from all companies but in D365 we need to make sure we have data in tables for company where you are running that query.

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi Manishspatel,

    There was a similar thread the other day, he joined multi-table, but the field data is empty, so there is no way to return data

    You can also check your data.

    [View:https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/366236/when-adding-projinvoicetable-to-a-query-queryrun-get-no-longer-works-for-child-data-sources/965635#965635:750:50]

    Looking forward to your feedback, are there any other exceptions?

  • Verified answer
    Uddipta Bhattacharya Profile Picture
    10 on at

    Try to override the PostLoad method at table level and then try to debug the query, it should work.

    p.s. Remove the method after debugging as it impacts performance.

  • Sukrut Parab Profile Picture
    71,741 Moderator on at

    Which query is this ?  Are you creating the query object in the same code you shared in your screen shot ? If yes share your code .

  • Community Member Profile Picture
    on at

    Thank you all. I found the problem. One of the Table in Join didnt have data. I think the way i was debugging is the best approach.

  • Ajit Profile Picture
    8,788 on at

    Thanks for the update. Would you mind marking the answers verified if they were helpful.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans