User Management Module

hello, I am using User Management module to create users and assign roles, primary table is “Account” (generalized from System.user), defined roles are “Employee” and “Manager”.  I want to be able to assign Manager when I am creating a new user/account, The manager itself should have an account first with a Role as “Manager”. Create new account/user page looks like below, I want to add another dropdown/Reference Set for the list of all “Manager” user  just underneath the  “User Role” reference set. Could you please advise what is the best way to achieve it?    Mendix Version: 8.18.1 or 2 or 3 Regards Johnson.
2 answers

This can be done by

  1. adding a 1-* self reference to the account entity
  2. Rename the association to Account_AccountManager, to have a distinctive association
  3. Add reference selector to the page Account_New (_Edit if needed)
  4. Set data source attribute (path) Administration.Account_AccountManager/Administration.Account/Administration.Account.FullName
  5. Set selectable objects Source; XPath with XPath constraint; [System.UserRoles = '[%UserRole_Manager%]']
    If you want to limit the list to managers

User roles should not be a dropdown but a reference set. Because you can add multiple roles to the account.