Skip to main content

Notifications

Community site session details

Community site session details

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

How to get the query of the data entity?

(0) ShareShare
ReportReport
Posted on by 1,493

Hi,

How can i get the query of a certain data entity? 

  • .. Profile Picture
    1,493 on at
    RE: How to get the query of the data entity?

    Hi Nikolaos,

    I thought it's working fine.. As i didn't see any repeated records before and i can't reproduce the issue in my dev machine as it's nit happening so i thought maybe there is sth wrong with the entity that i don't know.

    I will continue in the other thread

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to get the query of the data entity?

    Hi IntegrationBeginner,

    I'm a bit confused. You say that the entity is working fine, and now you say you're getting unexpected data with recurring integration. Doesn't that mean that the entity is NOT working?

    I recommend that we continue your recurring integration change tracking discussion in the other topic that you started (community.dynamics.com/.../repeated-records-in-recurring-integration).

  • .. Profile Picture
    1,493 on at
    RE: How to get the query of the data entity?

    I forgot to add to the previous reply the query error

    IMG_5F00_20211005_5F00_152702.jpg

  • .. Profile Picture
    1,493 on at
    RE: How to get the query of the data entity?

    Hi Nikolaos,

    So it's ok that the query is wrong even though the entity is working?

    Yes i'm trying to solve the problem described in this question.

    I'm getting repeated records when using recurring integration in a different environment

    community.dynamics.com/.../repeated-records-in-recurring-integration

  • nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to get the query of the data entity?

    You're saying that the entity is working correctly. So what exactly are you trying to achieve now? Do you have a business problem that you're trying to solve?

    Anyway, the view that you see in the database is the one that D365 creates from your entity. But the entity execution in D365 is more than just that view - so you can't always expect 1:1 results from running the entity and querying the SQL view.

  • .. Profile Picture
    1,493 on at
    RE: How to get the query of the data entity?

    Hi nikolas and sheikh,

    But how come the entity is working correctly and i get no build errors

    I mena what should i change if i can't see any errors?

    Also i noticed that in the standard data entity ledgerjournalentity... There was no on condition next to the inner join and it was done later but it didn't fail when running it

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to get the query of the data entity?

    Hi IngegrationBeginner,

    what you see in the database is created by D365 based on the entity definition that you have developed in Visual Studio. So if you see some issues here, you must figure them out and fix them in the entity definition in the Visual Studio.

  • Suggested answer
    Sheikh Sohail Profile Picture
    6,125 on at
    RE: How to get the query of the data entity?

    I am not sure what exactly is your case, but in general, with the OOTB data entity, the query should run properly without having any issues.

    If this is a custom data entity, then you need to check, how you developed the data entity. the data entity is actually viewed in the database, so what you will develop will be shown as it is in the database.

  • .. Profile Picture
    1,493 on at
    RE: How to get the query of the data entity?

    Hi Andre,

    I took part of the query. As you can see T7 doesn't have an ON condition for the inner join

    If i move the on condition highlighted in yellow next to T7 then the query for the entity runs (as this is the relation on the entity itself) 

    But why is it wrong from the first place? 

    IMG_5F00_20211005_5F00_132650.jpg

  • André Arnaud de Calavon Profile Picture
    294,099 Super User 2025 Season 1 on at
    RE: How to get the query of the data entity?

    Hi IntegrationBeginner,

    You asked a question for some general information and now it appears that you have a specific issue. Can you share more details about what you are working on and what error you get?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,099 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans