Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

How to get value from TabPage

Posted on by 920

Hi,

I want to develop many tabPage:

in the first tabPage  I get the user id and the username like this:

2084.user.png

in the second tabPage i want to get the  user selected in previous tabpage and the roles of this user :

1145.role.png

How can I do this?

*This post is locked for comments

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: How to get value from TabPage

    It is the same problem. Last time you wanted to list roles and see the users that are associated with the selected role. Now you want to list users and see the roles that are associated with the selected user. You can achieve both with exactly the same logic and mechanism.

    If you apply the knowledge and logic from the previous case, you can solve this one too.

  • BASMA Profile Picture
    BASMA 920 on at
    RE: How to get value from TabPage

    Hi Nikolaos,

    it's not the same problem

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: How to get value from TabPage

    By the way, you had this problem already last week, asked about it in this forum, and we resolved it. So how come you have the same issue again?

    [View:https://community.dynamics.com/ax/f/33/t/290929]

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: How to get value from TabPage

    You can find an overview in documentation under Using Joins with Form Data Source Tables.

    The most important thing to realize is that the property can be used for two very different things: joins (InnerJoin, OuterJoin, ExistJoin, NotExistJoin) and links (Delayed, Active and Passive). The most common (by far) are delayed links and inner joins.

    If you use joins, you combine tables together in a single query. For example, if you join two users and they have five related roles, you get a single resultset with five records.

    If you user a link, you get two separate queries. The child datasource is merely filtered by what's in the active record of the parent datasource (if a relation exists between them). This is what you want in your case.

    Feel free to create a new thread if you want to discuss these things in detail.

  • BASMA Profile Picture
    BASMA 920 on at
    RE: How to get value from TabPage

    I have confusion between the differents links in datasources.

    Have you some examples that help me to understand all the links?

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: How to get value from TabPage

    Sure, because you still have inner join between UserInfo and SecurityUserRole. Please change it to Delayed.

    By the way, do you understand what inner join does?

  • BASMA Profile Picture
    BASMA 920 on at
    RE: How to get value from TabPage

    I set the userinfo the main datasource(linkType=delayed),

    SecurityUserRole : joinSource=UserInfo,LinkType=innerjoin

    SecurityRole : joinSource=userInfo,linkType=innerjoin

    I set the datasource property in the grid to userInfo.

    But always the user is repeated.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: How to get value from TabPage

    What I meant is showing the list of users (not filtered by any join), with SecurityUserRole  linked to it via Delayed Link.

    You have SecurityUserRole instead of UserInfo as the main data source. Its LinkedType is irrelevant, because it doesn't have any parent. And you have it joined with UserInfo, which is completely wrong. No wonder you get users repeated; you see once for every role it has, because you joined these tables together.

    Please fix these things. Than make sure that your first grid is bound to UserInfo and try running your form again.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: How to get value from TabPage

    Your main data source (the one that is not related to other data sources) seems to be SecurityUserRole. This means that your grid will show as many records as there are in SecurityUserRole table. If a user has 3 roles, you will see 3 records for that user in your grid.

    If you want to show a list of users on the first tab page, your main data source should be UserInfo. Other data sources should be joined to that.

  • BASMA Profile Picture
    BASMA 920 on at
    RE: How to get value from TabPage


    these are the laisions between the data sources:

    1033.grid.png

    securityuser.png

    5807.securityrole.png

    this is the grid : 

    1033.grid.png

    When I open the form I get : 

    0728.form.png

    the user is repeated.

    in the 2nd tab I get all the roles not the roles specified to the active user.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans