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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Simple Query - SalesLine and SalesTable relation

(0) ShareShare
ReportReport
Posted on by 678

Hi All,

It seems that there is a 1:N relation between SalesTable.SalesId and SalesLines.SalesId. 

When I create a simple query, can I also add SalesLine  as a child data source of SalesTable ? or should it be always the case that the SalesTable is the child data source of the SalesLine in the query if I want to relate these two tables each other? 

Thank you. 

I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shawn,

    You can add SalesTable as a child datasource to SalesLine in your query. You can check the query SalesLineSRS as an example.

    pastedimage1612345947083v1.png

  • ShawnDEV Profile Picture
    678 on at

    Hi Sorry,

    the other way round..  can we add Sales Line as a child data source of Sales Table?

  • Suggested answer
    Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    Yes, you can.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shawn,

    Yes, you can always do that. You can check the query SalesTableListPagePartiallyPicked as am example. If you are looking to loop through all the data, you should change the Fetch mode for "SalesLine" datasource to "OneToN".

  • ShawnDEV Profile Picture
    678 on at

    Thank you.

    I would like to make a relation btw ReqTrans and InventTrans.

    I have ReqTrans as a main data source and added SalesTable as a child data source.

    Then I wonder if I have to add SalesLine as a child data source of SalesTable or add it under ReqTrans data source directly and add a relation.

    what is the preferred way of working?

    Thank you.

  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    It depends of what you want to achive. Joining a table with an order header or an individual order line are two different things.

  • ShawnDEV Profile Picture
    678 on at

    In my case, the latter is the purpose. 

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shawn,

    If your requirement is to join ReqTrans with InventTrans, Why don't you join ReqTrans with InventTransOrigin and join InventTrans to InventTransOrigin? Or do you need the data from sales orders as well?

  • ShawnDEV Profile Picture
    678 on at

    Yes. I need data from Sales order as well.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    If you need sales order line details only you can try joining SalesLine to InventTransOrigin based on the field InventTransId.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans