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 :
Microsoft Dynamics AX (Archived)

Conditional Table Relation..

(0) ShareShare
ReportReport
Posted on by 655

Is it possible to set a conditional table relation in AX in the sense that the value of a field in the parent table would dictate what child table the relationship is linked to.

Lets say for example I have field called "Account Type" and its an enum that can be Customer or Vendor.

I then have a field called "Account No.", I would like the relationship of my field "Account No." to be to the CustTable if "Account Type" == Customer and the VendTable if the "Account Type" == Vendor.

Is this possible?

t

*This post is locked for comments

I have the same question (0)
  • MukeshHirwani Profile Picture
    1,180 on at

    U can add conditional relation to the table.

    There are two types of conditional table relations:

    Relation Type

    Format

    Description

    Field fixed

    Field fixed

    (Table.Field == <EnumValue>)

    Restricts the records selected in the primary table. Only records that meet the condition are selected.

    The condition is ANDed with your relation.

    Related field fixed

    Related field fixed

    (<EnumValue> == Table.Field)

    Restricts the records selected in the related table. Only records that meet the condition are selected.

    The condition is ANDed with your relation.

     

    Detailed description with scenario: http://msdn.microsoft.com/en-US/library/bb190115(v=ax.10).aspx

  • Tony  Hemy Profile Picture
    655 on at

    Thanks Mukesh, I have attempted this but perhaps I am missing something?

    When I read this part of the MSDN article :

    Using conditional relations makes it possible to look up information in three different tables from the same field in the Orders table. The table that Microsoft Dynamics AX uses is determined by the CollectionType enum value in the CollectionTypeID column in the Orders table.

    I understand it to mean that I can add a relationship to a table to each of my possible enum values, however when I try that I do not seem to be able to lookup a table...

    Do I have this incorrect?

    t

  • Verified answer
    Community Member Profile Picture
    on at

    As an example please see table PriceDiscAdmTrans, which has relations to both CustTable and VendTable (among others).

  • Tony  Hemy Profile Picture
    655 on at

    Thank you Janet. I will go take a look.

    Much appreciated

    t

  • Tony  Hemy Profile Picture
    655 on at

    Thanks Janet, that helped me out greatly and I was able to abstract what I needed.

  • Community Member Profile Picture
    on at

    Great!

  • Lhamo Dolma Profile Picture
    292 on at

    This is exactly where i'm stuck on. I've I requirement where I need to link a third table relation to it.

    A good example of what i'm trying to do is the Journal lines/price discount agreement form under sales and marketing module. Under the overview tab, there is account code and account selection. I'm trying it to set it so that new will link account selection my new form/table drop-down. I apologize for this lengthy description. Please let me know if more clarification is needed.

    I've a table with AccountRelation field(extends to PriceDiscAccountCode) and AccountRelation field(extends to PriceDiscAccountRelation). So I the Accountcode selection is "table" then it will show customer name and account drop-down in account selection field. However, if the Accoundcode selection is a "group" then I need account selection to show a new drop-down(custom table). I've tried creating a table relation of type normal to new field from the new table... but this doesn't pull in the cust/vent table relation. Any tips on how I can get this to work without writing systablelookup code? I'm trying to use table relation to create drop-down.  

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

    For reference, Lhamo has a separate thread for her question, with more details and already with some replies.

  • Community Member Profile Picture
    on at

    This helped so much, just looked it up. Thanks.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans