Tips & Tricks - Import superiors from Active Directory
In this article, we will show you how to import superiors when importing users with LDAP if they are assigned in the Active Directory (AD).
Configure replication job
Switch to the "User" module. Select the main menu "Users / User and group import".
Click on "Edit" to edit your existing connection or on
"Add" to create a new connection. Click "Next".
In the next dialog, enter the name of the connection and select "LDAP" as the source. If replication already exists, click directly on "Next".
Click here on Add. Assign a name for the new Replications.xml. Select "Active Directory" as the template and click Next.
Search here for <!-- Import of boss --> and remove the line <!- at the beginning of the block and the line --> at the end of the block. This activates the block of code and automatically transfers the superior from the AD during the next replication job. Click "OK" and follow the further instructions of the wizard to finish configuring the replication job. The replication can be performed immediately in the last step.
Superiors in the user account
If the replication is successful, you will now find the assigned superiors in each user account on the "Organization" tab.
Use superior name in applications
In the Users module, the superior is stored in each user account only with their ID. To display the superior name in applications, please follow the steps below.
Drop-down list
The full name of supervisors can be displayed in selection lists and the ID can be saved. In the properties dialog of the selection list on the "Entries" tab, select "Values from applications" as the data source and then the "User" application. Select "(PK) (S) User ID" as the saved value. Full name" is used as the display value here. This means that the name of the superior will be displayed instead of the ID in the browser.
The filter must be set so that the employee's correct manager is also displayed. Select "(PK) (S) User ID" as the data field again. Select "Equal" as the operation and the option "Current user" with the value "Superior ID" as the comparison.
Edit field
If you do not need to display the name for input, you can simply use the input field with the data type "Integer". Select the option "Current user" and "Supervisor ID" as the default. This means the superior ID of the current user is automatically entered into the field when the page is loaded.
View table
To display the supervisor's name in view tables, include the data field with the supervisor ID as a column in the table's properties dialog and select the "User information" control type. Then click on "Edit column". On the "Options" tab, set the "Show link to user information" setting.
View field
To display the full name of the supervisor in view fields, select "User information" as the type of control when creating the element when selecting the existing data field.