Auto Creation of Users

Not applicable

Hi

I have a table in the DB called EMPLOYEE. From this, I want to automatically create new users in the SYS_USER table.

So, how can I maintain SYS_USER (insert update delete) based on changes in EMPLOYEE? I suppose it will have to be some kind of scheduled import job.

I hear that Business Rules is not the way to go.

Cheers
Dave

11 REPLIES 11

RobWoodbyrne
Tera Contributor

Is the 'Employee' table necessary?

You want some users, for example HR users, to create new Employees, but you don't want everybody being able to change user records, and maybe you also would like an Employee directory, if this is the requirement, you might consider this:

There is already a default 'user_admin' role which will allow users which have it to modify and create new users. You can also create an 'Employee Directory' by creating a new Module which is a 'List of Records' on the 'User' table, with a filter of 'Company' is '[Your Company]' (What we have done is created a 'Type' choice list on our User table, then our filter is 'Type' is 'employee')

This way you don't have to have separate tables of 'Users' which could potentially get out of sync.

There might be more to it than that, so let me know if there are additional details which make this an option that is not viable.



Hi.

I don't quite understand your answer, and I don't think you understood my original question.

The information in EMPLOYEE is updated from an external automated source. The idea is that we want to automatically create users, based on changes to EMPLOYEE on a daily basis. How do I do that?

Iow, a script can look at EMPLOYEE each morning, and see if there is anyone new there. If there is, create a new user in SYS_USER. Obviously likewise for delete & update.




RobWoodbyrne
Tera Contributor

Well there are a couple of ways that would have made this easier up front, even if you could not integrate this external source directly to the sys_user table, for example, you could have created reference fields on your EMPLOYEE table that referenced the fields on the sys_user table, then the updates would have been automatic. You could have also extended the System Import Set Row (sys_import_set_row) table with your 'EMPLOYEE' table, then leveraged Import Sets to automatically update the sys_user table.

Since this is already created, I think the business rule that looks for changes to the EMPLOYEE table, then updates the sys_user table would be a good option.


How can I make it that the Business Rules respond to External changes?

The only time I could a Business Rule to respond, was when I made changes in an Application GUI for my new table in SN itself.

But the idea here, is that the system should respond to changes made externally.