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)

Many-to-many UI in AX 2012

(0) ShareShare
ReportReport
Posted on by 455

Hi everyone,

I need to implement the UI for many-to-many relationship and wonder if there's an existing pattern for it in 2012.

I have a custom table that links to retail payment methods table (RetailTenderTypeTable) and since it's many-to-many there's another custom table in between that keeps RecIds from both sides.

For the UI I'm using the SimpleListDetails template. On the left side I have a grid with my custom table. On the right there're fast tabs, one of them contains an ActionPane and a grid. The idea is that adding a new record in that grid should allow for lookup selection of a method of payment from RetailTenderTypeTable but once the selection is made it should create a record in the association table. 

Can you give me a clue how to implement this in the UI? Is there something similar in AX OOB that I can use as sample?

Thank you!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ivan (Vanya) Kashperuk Profile Picture
    on at

    Item model group and Item group selection for a released product is a many-to-many relationship on the DB level.

  • Suggested answer
    Andrew Xu Profile Picture
    3,877 on at

    Hi Alex,

    Form InventItemGroup is the form you would want to refer as a sample.

    In that form,

    InventItemGroup -> your custom table

    DimensionAttributeValueCombination -> RetailTenderTypeTable

    InventItemGroupForm -> your association table.

  • Alex Kaganov Profile Picture
    455 on at

    Vanya - thanks you for the quick reply! You're right about the many-to-many relationship between InventTable and ItemModelGroup on the db level. However, it is not supported in the UI as released products only allow for single item model group selection so effectively it creates 1-to-many relationship.

    Andrew, you're spot-on on what I've been looking for. Alas, InventItemGroup form does not allow any editing to the association table. It's read-only and adding new records is where I'm having trouble.

    Here's what I achieved so far. Maybe you guys could help me from there. I think I'm just missing one little step.

    On the form I added two data sources - one for my first table and another one for association table, the second one is linked to the first with Delayed Link Type. I also have RetailTenderTypeTable as a reference data source on the second data source so I could drag the fields from there to the grid.

    It all works, the only issue being that I have a RecId on the UI. Other columns belong to the reference data source and don't let me run lookup. I could probably rewrite them as data methods on association table and/or overwrite form control's lookup method. Is this the best way? How would I receive the result of the lookup to pull the RecId and add it to my association table?

    Here's how it looks.


  • Verified answer
    Community Member Profile Picture
    on at

    As per my understanding you approach is good enough.

    for lookup you should consider having reference group control

    Please review following link

    msdn.microsoft.com/.../gg845085.aspx

    Please verify and update us if this helps you.

  • Alex Kaganov Profile Picture
    455 on at

    Thanks for your support, Nitesh!

    The last piece of the puzzle was that RetailTenderTypeTable didn't have correct AutoIdentification OOB so I couldn't pull reference group control. Fixed that and now I have the form complete!

    Everyone, thanks a lot for your help!

  • Community Member Profile Picture
    on at

    Please mark the appropriate post as verified answer will help other team members having same issue.

    Please help

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