Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Form Link on Many to Many Relationship

(0) ShareShare
ReportReport
Posted on by 31
Hello i have a problem about many to many relationship
 
I have 3 tables
1. MasterCodeType -> PK (Name)
2. ProductCodeType -> FK (MasterCodeType .Name), FK (InventTable.ItemId)
3. InventTable -> PK (ItemId)
 
ProductCodeType is mapping table for MasterCodeType and InventTable.
 
I'm adding button to Released Product action pane to go ProductCodeType form and user can add many of CodeType based on MasterCodeType for 1 Item/Product.
The AX standard behavior, if we open ProductCodeType form from Released Product, it will automatically link the selected ItemId so user only created CodeType for 1 Item/Product based on selected Product ItemId.
 
The problem is i add new field in PurchLine called CodeType, it's a dropdown based on CodeTypes that exist in PurchLine ItemId and if the user want to create CodeType on PurchLine ItemId by clicking view details on PurchLine CodeType to go ProductCodeType Form, the AX behavior becomes inconsistent. The ProductCodeType Form not linked with PurchLine ItemId, Please how to solve it? Thanks
  • Martin Dráb Profile Picture
    Martin Dráb 230,569 Most Valuable Professional on at
    Form Link on Many to Many Relationship
    Please never describe a problem just by "I get some errrors". It tells us nothing, therefore it prevents us from helping you.
     
    How did you create the relation and what problem did you have with it.
     
    Regarding code, please show us your code, tell us where you're getting an errors, whether it's a compilation error or a runtime exception and what the error message says.
  • AB-21051008-0 Profile Picture
    AB-21051008-0 31 on at
    Form Link on Many to Many Relationship
    Thanks for your answer, i learn new keyword about dyalink. But Previously, I have provided a relationship on the PurchLine and ProductCodeType tables. Can you give me example code to create dyalink between PurchLine and ProductCodeType, because i have try to create dyalink and get some errrors
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,569 Most Valuable Professional on at
    Form Link on Many to Many Relationship
    You can create a relation between PurchLine and ProductCodeType tables to get the dynalink created automatically.
    Another option is adding a dynalink or a query range in code.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans