Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/02/2024 02:19 PM
Hi,
We have a requirement where we need to generate username for employees and contractors as per the following logic:
Username should start with E followed by 80001 like E80001, E8002 and so on if user is an employee and C70001, C70002 and so on if non-employee.
Currently I am using the following query in the register user rule:
CASE WHEN (users.employeetype= 'Employee') THEN CONCAT('E8000',FN_EIC_SEQGEN('1')) ELSE CONCAT('C7000',FN_EIC_SEQGEN('1')) END
The only problem I am seeing is it goes as 1,2,3,4 irrespective of employeeType.. like if I create 2 employees followed by the contractor then contractor ID will be C70003 and not C70001.
Is there a way I can use 2 sequence generators for the above use case.