Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Table relations defined in one table but not the other?

Posted on by 115

I'm confused with table relations.  For example, if you look at the relations for CustTable, there is nothing for SalesLine, but if you look at the SalesLine table's relations, you see the relation to CustTable.  Is there a reason this relationship is only documented in the SalesLine table's relations?

Also, is it possible to have relations that are not defined in the Relations section for either table, and, if so, what are the ramifications? 

Also, are these relations used when defining link types for data sources?  Otherwise, when you specify something like "inner join", what are you even joining on?

*This post is locked for comments

  • Suggested answer
    Satish Panwar Profile Picture
    Satish Panwar 14,645 on at
    RE: Table relations defined in one table but not the other?

    SalesLine is first level data source (though it's linked with SalesTable), the automatic relation is being used. Expand the SalesLine data source and notice the next data source i.e. logisticsPostalAddressDeliveryLine and you will see joinrelation field and join table. The property / field / and how relations are defined vary in the application. After all this, what are you trying to do? Are you trying to create a form.. if yes, try to add multiple data source and see if you get data as expected or something is wrong. If it's wrong, then try to identify where to define relations etc, just understanding where is not going to help you unless you try to do it.

  • Mark Boy2 Profile Picture
    Mark Boy2 490 on at
    RE: Table relations defined in one table but not the other?

    Did you see the join datasource Option ?

  • AXGreenHorn Profile Picture
    AXGreenHorn 115 on at
    RE: Table relations defined in one table but not the other?

    3223.salesline.PNG

    Satish, this is the SalesTable form.  You see how the SalesLine is set to join with the SalesTable.  But I do not see an option to use the table relations.

  • Suggested answer
    Satish Panwar Profile Picture
    Satish Panwar 14,645 on at
    RE: Table relations defined in one table but not the other?

    Hi AXGreenHorn,

    Please let us know if you have any further questions on this thread.

    Thanks,

    Satish Panwar

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Table relations defined in one table but not the other?

    CustTable stores customer master data.

    If any table includes Customer account field, a relation to CustTable should be defined in that table. This is how relational databases work.

    But, you don't need to change the definition of CustTable (by defining new relations) every time a new table with CustAccount field is introduced.

  • Mark Boy2 Profile Picture
    Mark Boy2 490 on at
    RE: Table relations defined in one table but not the other?

    Oh, Satish said the relation using on the query(datasource)/form(datasource) and so on , but you only focus on the table~

    for example:

    when you create a form or query, you add the InventTable and InventTrans to datasource,

    you just go to the sub-datasource property and select the use relation to change “yes”

    then both of tables's relation will be created.. do not create by manual.

    In addition , this is only possible if there is already a table association relationship.

  • Suggested answer
    Satish Panwar Profile Picture
    Satish Panwar 14,645 on at
    RE: Table relations defined in one table but not the other?

    Agree. The screenshot that you I provided above is from Queries. To which data source the above form linked to? I think it's form data source. If that's what it is, take a look at SalesTable form, expand the salesTable data source, go to next data source underneath salesTable and see the property join relation. The property name is different based on what you look at. Can you share complete screenshot that shows your AOT objects and your property if above response doesn't help you much.

    Thanks,

    Satish Panwar

  • AXGreenHorn Profile Picture
    AXGreenHorn 115 on at
    RE: Table relations defined in one table but not the other?

    Satish,

    I'm sorry, but I can't accept your answer yet because I cannot find a similar option in AX 2012 to only use the table relations.  Here is what I see:

    data-source.PNG

    I don't think any of these properties are the equivalent.

  • Suggested answer
    Satish Panwar Profile Picture
    Satish Panwar 14,645 on at
    RE: Table relations defined in one table but not the other?

    Glad that it helped. Please see below (it's from D365 but similar property will exist there as well. Note - I have highlighted the second data source in my query. For first data source "CustTable", the property doesn't apply and doesn't exists. Please click 'Yes' against the answers that helped you.

    pastedimage1562960234547v1.png

    Thanks,
    Satish Panwar
    Please help verify answer(s) if they guide you in right direction so other community members can also benefit from your question with verified answer.

  • AXGreenHorn Profile Picture
    AXGreenHorn 115 on at
    RE: Table relations defined in one table but not the other?

    Everything you said makes sense, however, I do not see the "use relations" property that you talked about.  Can you screenshot where you are seeing 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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans