Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AOT table relation from two fields to the same table

(0) ShareShare
ReportReport
Posted on by 280

Hi there

Running AX 2012 R3 CU9

This is probably a simple solution I'm missing - I have a table (we will call Table1), and I have two separate fields on that table with EDT CustCurrencyCode.

The problem is, the first one I added got a relation as expected, but the second one didn't, and it seems to dislike me adding the relation manually. As though there's a conflict with linking to the same table twice.

I get two error messages, one for each relation: 'RelatedTableRole' conflicts with another 'RelatedTableRole' on relation Currency on table [Table1]'.

I could technically force the lookup on my form to look at the currency table, but if it's possible I'd prefer to use the built-in functionality so it propagates anywhere else in the system this second field will show up.

I looked up some documentation on this: https://blogs.msdn.microsoft.com/axsupport/2015/12/17/how-to-add-a-new-relation-for-a-new-field-to-the-same-table-to-which-a-relation-already-exists-ax-2012/  but it looks like it's already a step ahead of where I am in that it works, but there are some pitfalls later on.

Any help would be much appreciated, if there's something I'm missing

*This post is locked for comments

  • Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: AOT table relation from two fields to the same table

    I don't say that it is wrong, i just want to say that using EDT which already has a relation it is enough for getting lookup on the field.

  • lukbel Profile Picture
    lukbel 280 on at
    RE: AOT table relation from two fields to the same table

    Hey, it worked! Cheers ievgen

    I just set it to the name of the second field - is it just a placeholder string to define the relation?

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: AOT table relation from two fields to the same table

    It was true for 2009, in 2012 you have to have all relations explicitly specified on a table, at least that's what BP says, why do you think that it is wrong ?  

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: AOT table relation from two fields to the same table

    Hi lukbel!

    You don't need to create relation to Currency table in your table relation node, because of EDT has it already.

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: AOT table relation from two fields to the same table

    Hi lukbel,

    RelatedTableRole property of the relation is populated automatically based on a table name. You have 2 relations with the same table and both have the same name, but it should be different, to fix that, just set RelatedTableRole for second one.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February 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... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans