Hi ,
I have form :
in this form I want to get the list of user assign to the role and the organization choiced in the filter.
this is the structure of form:
*This post is locked for comments
I add this :
while select userinfo1 exists join securityUserRole where securityUserRole.SecurityRole == securityRole.RecId && securityUserRole.User == userinfo1.id
notexists join omUserRoleOrganization where omUserRoleOrganization.SecurityRole == securityRole.RecId && omUserRoleOrganization.User == userinfo1.id
//notexists join omUserRoleOrganization where omUserRoleOrganization.User == securityUserRole.user
{
Utilisateur.add(userinfo1.name);
}
and it works .
Hi BASMA!
Try to add omUserRoleOrganization.OMInternalOrganization == omInternalOrganization.RecId to second statement where used notexists join
while select userinfo1 exists join securityUserRole where securityUserRole.SecurityRole == securityRole.RecId && securityUserRole.User == userinfo1.id notexists join omUserRoleOrganization where omUserRoleOrganization.User == securityUserRole.user
&& omUserRoleOrganization.OMInternalOrganization == omInternalOrganization.RecId { Utilisateur.add(userinfo1.name); }
Hi Rustem, when I use this method:
for example when I have user that assigned to role A with all organization and assigned to another role B in organization A.
When I filter with role A and with any organization I don't get the name of user.
Utilisateur.clear();
//select the list of user assigned to the role and organization
if(Role.text() != "" && Organisation.text() != "")
{
while select userinfo1 exists join omUserRoleOrganization where omUserRoleOrganization.SecurityRole == securityRole.RecId
&& omUserRoleOrganization.OMInternalOrganization == omInternalOrganization.RecId
&& omUserRoleOrganization.User == userinfo1.id
{
Utilisateur.add(userinfo1.name);
}
while select userinfo1 exists join securityUserRole where securityUserRole.SecurityRole == securityRole.RecId && securityUserRole.User == userinfo1.id
notexists join omUserRoleOrganization where omUserRoleOrganization.User == securityUserRole.user
{
Utilisateur.add(userinfo1.name);
}
}
//select the list of user assigned to the role and not assigned to organization
else if(Role.text() != "" && Organisation.text() == "")
{
while select userinfo1 exists join securityUserRole where securityUserRole.SecurityRole == securityRole.RecId
&& securityUserRole.User == userinfo1.id
{
Utilisateur.add(userinfo1.name);
}
}
thanks Rustem for your help :)
thanks Rustem,
have you document about join tables?
I’ve updated the code in previous post.
Try this:
Utilisateur.clear(); if(Role.text() != "" && Organisation.text() != "") { while select userinfo1 exists join omUserRoleOrganization where omUserRoleOrganization.SecurityRole == securityRole.RecId && omUserRoleOrganization.OMInternalOrganization == omInternalOrganization.RecId && omUserRoleOrganization.User == userinfo1.id { Utilisateur.add(userinfo1.name); } while select userinfo1
exists join securityUserRole
where securityUserRole.SecurityRole == securityRole.RecId
&& securityUserRole.User == userinfo1.id notexists join omUserRoleOrganization where omUserRoleOrganization.User == securityUserRole.User { Utilisateur.add(userinfo1.name); } } else if(Role.text() != "" && Organisation.text() == "") { while select userinfo1 exists join securityUserRole where securityUserRole.SecurityRole == securityRole.RecId && securityUserRole.User == userinfo1.id { Utilisateur.add(userinfo1.name); } }
And i recommend to learn more about how to join tables.
I have this form:
I want to display a list of user that are assigned to selected role and organization.
for example in the selected role "A"there is a user "userA" that has access to all organization:normally when I select role "A" and I select one of organisation I should get the "userA" in the list.
now i get only the users exist in OMUsrOrgnizationRole.
I hope that you understand me
Can you explain what you want to achieve?
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156