When implementing Employee Central you can see some tough questions and it is good to prepare some answers. One of them is automatic generation of UserID. This UserID is used in whole system and all employee data are relevant to this ID. In data model it is called person-id-external and it is used for employee data import and many more. The typical question is how to populate the UserID automatically to cover our business processes.
We will go through several options today. The first option is to create UserID manually according to rules that you have. These rules can be so complex that you cannot cover them by EC rules configuration. This offer the biggest flexibility that you can use everything you want. You can combine names, numbers and special characters. This is the least recommended solution.
Let's move to different which is number two. This uses sequence, format template and business rule to create the UserID. The first is sequence configuration that can be done in Manage Data (or better in Admin tools - Employee files - Manage Sequence).
Create new sequence that will have start 0, step 1 (or if you want some gaps, enter different number). This sequence will be used in the business rules. The rule should looks like this:
Important are following fields:
BaseObject - recommend to select Biographical Information or Employee Information
IF condition - this means when the field is empty, the rules will be executed.
Template: E%05d - starting with "E" and then five zeros but the sequence will update the five zeros to 00001 for the first employee. So the result will be E00001. And with each new hire the number will be incremented.
Finally you need to assign the rule to the data model.
As onInit trigger rule the User ID will be populated when you enter the add new employee page. The onInit has some negative impact if you do not finish the process of adding employee completely. There can be gap in the employee IDs sequence so better is to use onSave business rule.
Now the third a maybe the best possible solution. This is the question whether the solution is the best. You will get more facts about it at the end. In this case we will focus on different usage and creating User ID from the name of the new employee. The next rule takes first letter from first name, first letter from middle name and complete last name and use it as UserID.
See that there is different base object used (it is necessary to access the employee name and user ID together). Rest is simple and the result looks amazing
It is set to business model as onChange action on Last Name. So when you update the last name then the User ID is populated. With the IF condition equals to null you cannot then change last name again and expect the update of User ID.
Now the advantages and disadvantages of described solutions:
Advantages:
Do you have any other experience or idea how to set the User ID? Let all know in the comments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |