Hi,
I want to develop many tabPage:
in the first tabPage I get the user id and the username like this:
in the second tabPage i want to get the user selected in previous tabpage and the roles of this user :
How can I do this?
*This post is locked for comments
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.
Hi Nikolaos,
it's not the same problem
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]
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.
I have confusion between the differents links in datasources.
Have you some examples that help me to understand all the links?
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?
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.
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.
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.
these are the laisions between the data sources:
this is the grid :
When I open the form I get :
the user is repeated.
in the 2nd tab I get all the roles not the roles specified to the active user.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156